Merge pull request #12147 from homer8173/patch-5
Fix user time instead of server time
This commit is contained in:
commit
ea2986037f
@ -5607,10 +5607,10 @@ class Form
|
|||||||
$reset_scripts = "";
|
$reset_scripts = "";
|
||||||
|
|
||||||
// Generate the date part, depending on the use or not of the javascript calendar
|
// Generate the date part, depending on the use or not of the javascript calendar
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(), 'day').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(), 'day', 'tzuser').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(), '%d').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(), '%d', 'tzuser').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m', 'tzuser').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y', 'tzuser').'\');';
|
||||||
/*if ($usecalendar == "eldy")
|
/*if ($usecalendar == "eldy")
|
||||||
{
|
{
|
||||||
$base=DOL_URL_ROOT.'/core/';
|
$base=DOL_URL_ROOT.'/core/';
|
||||||
@ -5627,7 +5627,7 @@ class Form
|
|||||||
{
|
{
|
||||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||||
//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
|
//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H', 'tzuser').'\');';
|
||||||
if ($fullday) $reset_scripts .= ' } ';
|
if ($fullday) $reset_scripts .= ' } ';
|
||||||
}
|
}
|
||||||
// Update the minute part
|
// Update the minute part
|
||||||
@ -5635,7 +5635,7 @@ class Form
|
|||||||
{
|
{
|
||||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||||
//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
|
//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M', 'tzuser').'\');';
|
||||||
if ($fullday) $reset_scripts .= ' } ';
|
if ($fullday) $reset_scripts .= ' } ';
|
||||||
}
|
}
|
||||||
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user