mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Issue #1157 - Should fix datepicker locale issue.
This commit is contained in:
@@ -66,11 +66,6 @@ function loadJSAddons()
|
||||
|
||||
e107::js('core', 'jquery.h5validate.min.js','jquery',2);
|
||||
|
||||
if(e_LAN != 'en')
|
||||
{
|
||||
e107::js('inline', buildDateLocale(),'jquery', 2);
|
||||
}
|
||||
|
||||
e107::js('core', 'jquery.elastic.js', 'jquery', 2);
|
||||
e107::js('core', 'jquery.at.caret.min.js', 'jquery', 2);
|
||||
|
||||
@@ -99,54 +94,7 @@ function loadJSAddons()
|
||||
|
||||
loadJSAddons();
|
||||
|
||||
/** Build the datetimepicker() locale, since it must match strftime() values for accurate conversion.
|
||||
*
|
||||
*/
|
||||
function buildDateLocale()
|
||||
{
|
||||
$text = ';(function($){
|
||||
$.fn.datetimepicker.dates["'.e_LAN.'"] = {';
|
||||
|
||||
$dates = array();
|
||||
|
||||
for ($i=1; $i < 8; $i++)
|
||||
{
|
||||
$day = strftime('%A', mktime(1,1,1, 1, $i, 2012));
|
||||
$dates['days'][] = $day;
|
||||
$dates['daysShort'][] = strftime('%a', mktime(1,1,1, 1, $i, 2012));
|
||||
$dates['daysMin'][] = substr($day,0,2);
|
||||
}
|
||||
|
||||
|
||||
for ($i=1; $i < 13; $i++)
|
||||
{
|
||||
$dates['months'][] = strftime('%B', mktime(1,1,1, $i, 2, 2013));
|
||||
$dates['monthsShort'][] = strftime('%h', mktime(1,1,1, $i, 2, 2013));
|
||||
}
|
||||
|
||||
|
||||
foreach($dates as $key=>$type)
|
||||
{
|
||||
$d = array();
|
||||
|
||||
$text .= "\n".$key.": [";
|
||||
foreach($type as $val)
|
||||
{
|
||||
$d[] = '"'.$val.'"';
|
||||
|
||||
}
|
||||
$text .= implode(",",$d);
|
||||
$text .= "],";
|
||||
}
|
||||
|
||||
|
||||
$text .= '
|
||||
meridiem: ["am", "pm"]
|
||||
};
|
||||
}(jQuery));';
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user