1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 18:30:53 +02:00

datepicker timezone fix.

This commit is contained in:
Cameron
2018-05-25 08:47:47 -07:00
parent 78213c4a31
commit d023cfc63c
2 changed files with 4 additions and 14 deletions

View File

@@ -1499,11 +1499,11 @@ class e_form
if(vartrue($options['inline'])) if(vartrue($options['inline']))
{ {
$text .= "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}'></div>"; $text .= "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}'></div>";
$text .= "<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' data-date-timezone-offset='".date('Z')."' />"; $text .= "<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' />";
} }
else else
{ {
$text .= "<input class='{$class} input-".$xsize." form-control' type='text' size='{$size}' id='e-datepicker-{$id}' value='{$value}' data-date-unix ='{$useUnix}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} {$disabled} data-date-timezone-offset='".date('Z')."' />"; $text .= "<input class='{$class} input-".$xsize." form-control' type='text' size='{$size}' id='e-datepicker-{$id}' value='{$value}' data-date-unix ='{$useUnix}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} {$disabled} />";
$ftype = (!empty($options['debug'])) ? 'text' : 'hidden'; $ftype = (!empty($options['debug'])) ? 'text' : 'hidden';
$text .= "<input type='{$ftype}' name='{$name}' id='{$id}' value='{$hiddenValue}' />"; $text .= "<input type='{$ftype}' name='{$name}' id='{$id}' value='{$hiddenValue}' />";
} }

View File

@@ -49,11 +49,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
newValue = $("#" + ev.target.id).val(); newValue = $("#" + ev.target.id).val();
} }
// make sure a UTC datestamp is saved $(newTarget).val( newValue);
offset = parseInt($item.attr("data-date-timezone-offset"));
newOffsetValue = newValue + offset;
$(newTarget).val(newOffsetValue);
}); });
}); });
@@ -79,13 +75,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
newValue = $("#" + ev.target.id).val(); newValue = $("#" + ev.target.id).val();
} }
// make sure a UTC datestamp is saved $(newTarget).val(newValue);
offset = parseInt($item.attr("data-date-timezone-offset"));
newOffsetValue = newValue + offset;
$(newTarget).val(newOffsetValue);
console.log( newOffsetValue); // remove later.
}) })
}); });