mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 04:40:44 +02:00
Support 'firstDay' option on JS calendar to set day of week for first column (0 = Sunday = default).
This commit is contained in:
@@ -594,16 +594,17 @@ class e_form
|
|||||||
$class = (isset($classes[$type])) ? $classes[$type] : "tbox e-date";
|
$class = (isset($classes[$type])) ? $classes[$type] : "tbox e-date";
|
||||||
$size = vartrue($options['size']) ? intval($options['size']) : 40;
|
$size = vartrue($options['size']) ? intval($options['size']) : 40;
|
||||||
$required = vartrue($options['required']) ? "required" : "";
|
$required = vartrue($options['required']) ? "required" : "";
|
||||||
|
$firstDay = vartrue($options['firstDay']) ? $options['firstDay'] : 0;
|
||||||
|
|
||||||
if(vartrue($options['inline']))
|
if(vartrue($options['inline']))
|
||||||
{
|
{
|
||||||
$text .= "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' ></div>
|
$text .= "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' ></div>
|
||||||
<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' />
|
<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' />
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "<input class='{$class}' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' {$required} />";
|
$text .= "<input class='{$class}' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' {$required} />";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
|
@@ -139,6 +139,7 @@ $(document).ready(function()
|
|||||||
$(this).datepicker({
|
$(this).datepicker({
|
||||||
dateFormat: $(this).attr("data-date-format"),
|
dateFormat: $(this).attr("data-date-format"),
|
||||||
ampm: $(this).attr("data-date-ampm"),
|
ampm: $(this).attr("data-date-ampm"),
|
||||||
|
firstDay: $(this).attr("data-date-firstday"),
|
||||||
showButtonPanel: true
|
showButtonPanel: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -148,6 +149,7 @@ $(document).ready(function()
|
|||||||
dateFormat: $(this).attr("data-date-format"),
|
dateFormat: $(this).attr("data-date-format"),
|
||||||
timeFormat: $(this).attr("data-time-format"),
|
timeFormat: $(this).attr("data-time-format"),
|
||||||
ampm: $(this).attr("data-date-ampm"),
|
ampm: $(this).attr("data-date-ampm"),
|
||||||
|
firstDay: $(this).attr("data-date-firstday"),
|
||||||
showButtonPanel: true
|
showButtonPanel: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -159,6 +161,7 @@ $(document).ready(function()
|
|||||||
$(this).datepicker({
|
$(this).datepicker({
|
||||||
dateFormat: $(this).attr("data-date-format"),
|
dateFormat: $(this).attr("data-date-format"),
|
||||||
ampm: $(this).attr("data-date-ampm"),
|
ampm: $(this).attr("data-date-ampm"),
|
||||||
|
firstDay: $(this).attr("data-date-firstday"),
|
||||||
defaultDate: $("#"+newid).val(),
|
defaultDate: $("#"+newid).val(),
|
||||||
onSelect: function(dateText, inst) {
|
onSelect: function(dateText, inst) {
|
||||||
$("#"+newid).val(dateText);
|
$("#"+newid).val(dateText);
|
||||||
|
Reference in New Issue
Block a user