mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
FIX date saving when using html dates (like with blind-user mode).
This commit is contained in:
@@ -7777,7 +7777,7 @@ class Form
|
||||
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="'.($usecalendar == 'html' ? "date" : "text").'" class="maxwidthdate center" maxlength="11" value="'.$formatted_date.'"';
|
||||
$retstring .= ($disabled ? ' disabled' : '');
|
||||
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
|
||||
$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
||||
$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($usecalendar == 'html' ? 'yyyy-mm-dd' : $langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
||||
$retstring .= ' autocomplete="off">';
|
||||
|
||||
// Icon calendar
|
||||
|
||||
@@ -243,15 +243,17 @@ function getObjectFromID(id){
|
||||
// Called after the selection or typing of a date to save details into detailed fields
|
||||
function dpChangeDay(dateFieldID, format)
|
||||
{
|
||||
console.log("Call dpChangeDay, we save date into detailed fields from format = "+format);
|
||||
console.log("Call dpChangeDay, we save date from field "+dateFieldID+" into detailed fields from format = "+format);
|
||||
|
||||
var thefield = getObjectFromID(dateFieldID);
|
||||
var thefieldday = getObjectFromID(dateFieldID+"day");
|
||||
var thefieldmonth = getObjectFromID(dateFieldID+"month");
|
||||
var thefieldyear = getObjectFromID(dateFieldID+"year");
|
||||
|
||||
console.log("string date value is " + thefield.value);
|
||||
|
||||
var date = getDateFromFormat(thefield.value, format);
|
||||
//console.log(date);
|
||||
|
||||
if (date)
|
||||
{
|
||||
thefieldday.value = date.getDate();
|
||||
|
||||
Reference in New Issue
Block a user