Fix user time instead of server time
it seems that we want to use a user time by clicking on now button. IDEA : may i use client time ??? because if page is old, the now button insert an old time.
This commit is contained in:
parent
6d05d42c50
commit
8d49609549
@ -5607,10 +5607,10 @@ class Form
|
||||
$reset_scripts = "";
|
||||
|
||||
// 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.'day\').val(\''.dol_print_date(dol_now(), '%d').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(), 'day','tzuser').'\');';
|
||||
$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','tzuser').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y','tzuser').'\');';
|
||||
/*if ($usecalendar == "eldy")
|
||||
{
|
||||
$base=DOL_URL_ROOT.'/core/';
|
||||
@ -5627,7 +5627,7 @@ class Form
|
||||
{
|
||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||
//$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 .= ' } ';
|
||||
}
|
||||
// Update the minute part
|
||||
@ -5635,7 +5635,7 @@ class Form
|
||||
{
|
||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||
//$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 reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
||||
|
||||
Loading…
Reference in New Issue
Block a user