diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 6eb7a84ac25..efc2a2a3157 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -7780,15 +7780,22 @@ class Form
if ($d) {
// Show date with popup
if ($usecalendar != 'combo') {
+ // Set $format and $formatjs and $formatjquery
+ $reduceformat = (!empty($conf->dol_optimize_smallscreen) ? 1 : 0); // Test on original $format param.
+ if ($reduceformat) {
+ $format = str_replace('%Y', '%y', $langs->transnoentitiesnoconv("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
+ $formatjs = str_replace('yyyy', 'yy', $langs->transnoentitiesnoconv("FormatDateShortJavaInput"));
+ //$formatjquery = str_replace('yyyy', 'yy', $langs->trans("FormatDateShortJQueryInput"));
+ $formatjquery = $langs->trans("FormatDateShortJQueryInput");
+ } else {
+ $format = $langs->transnoentitiesnoconv("FormatDateShortInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
+ $formatjs = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
+ $formatjquery = $langs->trans("FormatDateShortJQueryInput");
+ }
+
// Set formatted_date (for example: '%d/%m/%Y', '%m-%d-%y', ...
$formatted_date = '';
if (strval($set_time) != '' && $set_time != -1) {
- $reduceformat = (!empty($conf->dol_optimize_smallscreen) ? 1 : 0); // Test on original $format param.
- if ($reduceformat) {
- $format = str_replace('%Y', '%y', $langs->transnoentitiesnoconv("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
- } else {
- $format = $langs->transnoentitiesnoconv("FormatDateShortInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
- }
$formatted_date = dol_print_date($set_time, $format, $gm); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
}
@@ -7828,7 +7835,7 @@ class Form
$retstring .= '