1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Language fix for datetimepicker()

This commit is contained in:
Cameron
2013-11-21 19:43:00 -08:00
parent 9ab74b665c
commit 459ffe40de
3 changed files with 14 additions and 7 deletions

View File

@@ -64,8 +64,14 @@ function loadJSAddons()
e107::css('core', 'bootstrap-datetimepicker/css/datetimepicker.css', 'jquery');
e107::js('core', 'bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js', 'jquery', 2);
$bs_date_link = "bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.".e_LAN.".js";
if(e_LAN != 'en' && file_exists(e_WEB_JS.$bs_date_link)) // load datetime picker language file.
{
// e107::getMessage()->addDebug("Loading ".$bs_date_link);
e107::js('core', $bs_date_link, 'jquery', 2);
}
e107::js('core', 'jquery.elastic.js', 'jquery', 2);
e107::js('core', 'jquery.at.caret.min.js', 'jquery', 2);

View File

@@ -662,7 +662,7 @@ class e_form
}
else
{
$text .= "<input class='{$class} input-xlarge' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' {$required} />";
$text .= "<input class='{$class} input-xlarge' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} />";
}
// $text .= "ValueFormat: ".$dateFormat." Value: ".$value;

View File

@@ -155,23 +155,24 @@ $(document).ready(function()
// https://github.com/smalot/bootstrap-datetimepicker
$("input.e-date").each(function() {
$("input.e-date").each(function() {
$(this).datetimepicker({
minView: 'month',
maxView: 'decade',
autoclose: true,
format: $(this).attr("data-date-format"),
weekStart: $(this).attr("data-date-firstday")
weekStart: $(this).attr("data-date-firstday"),
language: $(this).attr("data-date-language")
});
});
$("input.e-datetime").each(function() {
$("input.e-datetime").each(function() {
$(this).datetimepicker({
autoclose: true,
format: $(this).attr("data-date-format"),
weekStart: $(this).attr("data-date-firstday"),
showMeridian: $(this).attr("data-date-ampm")
showMeridian: $(this).attr("data-date-ampm"),
language: $(this).attr("data-date-language")
});
});