Dolibarr: Date picker issue

Created on 22 Mar 2018  路  5Comments  路  Source: Dolibarr/dolibarr

Bug

The date picker returns unsuitable values, at least for German installation

Environment

  • Version: 7.0.0
  • OS: Linux (hosted)
  • Web server: nginx/1.11.10
  • PHP: 7.1.12
  • Database: MySQL or MariaDB 5.5.56-MariaDB

Expected and actual behavior

Selecting a date with the date picker should insert a valid date into the field.
Instead a wrongly formatted one is returned.

Steps to reproduce the behavior

When selecting a date with the date picker button the month is shown as text instead of number. Dolibarr unfortunately does not accept this (btw: neither is a 2-digit-year sufficient...).
So the field is filled in but on SAVE the content gets replaced by the actual date and an error message states "invalid date".
The "now"-link works as expected!

[Attached files]

Before having entered anything:
before
Picker is open, I choose "22":
during
Result:
after
...which should have been "22.03.2018"

Most helpful comment

You have to edit the german language file:
/dolibarr/htdocs/langs/de_DE/main.lang

Replace the following lines:

FormatDateShortJQuery=dd.MM.yy
FormatDateShortJQueryInput=dd.MM.yy

with

FormatDateShortJQuery=dd.mm.yy
FormatDateShortJQueryInput=dd.mm.yy

MM-> mm

All 5 comments

You have to edit the german language file:
/dolibarr/htdocs/langs/de_DE/main.lang

Replace the following lines:

FormatDateShortJQuery=dd.MM.yy
FormatDateShortJQueryInput=dd.MM.yy

with

FormatDateShortJQuery=dd.mm.yy
FormatDateShortJQueryInput=dd.mm.yy

MM-> mm

Thanks, works for me.
Anyway I wonder why this file was changed?

Hi,

it works partly. I'm not sure if it is the same error, but I'm not able to create a date after march. It won't take april or may as valid date.
The debug-log shows no issues.

After some tests against the austrian file I found out, that someone should ONLY replace the lines as suggestes by PierreKr until it is the following statement:

FormatDateShortJava=dd.MM.yyyy
FormatDateShortJavaInput=dd.MM.yyyy
FormatDateShortJQuery=dd.mm.yy
FormatDateShortJQueryInput=dd.mm.yy

Touching the first two lines will lead to the strange experiment, that no bill is able to be produced in April or later. My personal learing: Keep strict to the script :-)

Fixed in transifex for next stable version

Was this page helpful?
0 / 5 - 0 ratings