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