1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Incorrect value posted for datepicker() when date manually changed.

This commit is contained in:
Cameron
2016-06-04 15:03:13 -07:00
parent 50fff3e777
commit 82beb3385c

View File

@@ -991,15 +991,25 @@ class e_form
if ($datestamp)
{
// Create timestamp.
if(!is_numeric($datestamp))
if($useUnix == 'true')
{
$datestamp = strtotime($datestamp);
if(!is_numeric($datestamp))
{
$datestamp = strtotime($datestamp);
}
// Convert date to proper format.
$value = e107::getDate()->convert_date($datestamp, $dateFormat);
}
else
{
$value= $datestamp;
}
// Convert date to proper format.
$value = e107::getDate()->convert_date($datestamp, $dateFormat);
}
$text = "";
// $text .= 'dformat='.$dformat.' defdisp='.$dateFormat;
@@ -1036,6 +1046,25 @@ class e_form
}
e107::js('footer-inline', '
// Fix for changeDate() not being fired when value manually altered.
$("input.e-date,input.e-datetime").on("change", function(){
var useUnix = $(this).attr("data-date-unix");
if(useUnix !== "true")
{
var id = $(this).attr("id");
var newTarget = "#"+ id.replace("e-datepicker-","");
var newValue = $(this).val();
$(newTarget).val(newValue);
}
});
$("input.e-date").each(function() {
$(this).datetimepicker({
minView: "month",