Commit Graph
5 Commits
Author SHA1 Message Date
Adrien Dieudonne ab42507d46 [FIX] web: datepicker: notify all datetime changes
Before this fix, there was an issue when you changed the value of
a datetime field by editing direclty the input (without using the
datepicker popup).
If this value was equal to the offset of your timezone,
the new value wasn't saved. The problem was that no event was
triggered by the 'bootstrap-datetimepicker' lib because it
considered that the old datetime and the new datatime were the
same...

In odoo JS, we always manipulate UTC moment objects and we
manually add the timezone offset at rendering (we mainly do that
for testing purposes). When the offset is added, calling format()
on the moment object doesn't convert the datetime to the browser
timezone because it's flagged as being UTC.

The datepicker lib creates moment objects in the browser timezone.
So comparing the ones it creates with the one given by Odoo is
like comparing apples and oranges, and it gives wrong results
when the datetimes differ by the exact timezone offset. So in this
case, no 'datetime change' is triggered by the lib.

We could fix this by wrapping moment objects into some kind of
OdooDate class and stop manually adding the timezone offset, but
this would involve a refactoring that can only be done in master.

Instead, we prefered to patch the lib to ignore the comparison
between UTC and non-UTC objects, as this is the safest way we
find to fix this issue in stable version.
2017-12-04 14:46:12 +01:00
qsm-odoo 3741603495 [FIX] web: restore broken datepicker since lib update
There were two main problems with the datepicker since the lib was
updated:
- it appeared broken in the search view "Filters" menu
- it did not overflow the parent which scrolls

Indeed, before the update, the datepicker was placed in the <body/>.
Now this is a lib option. Unfortunately, the option is broken (I don't
know why they broke it since it worked before the lib update...). As the
lib does not expose its internal functions, the only found workaround was
to patch the lib code itself.

opw-745311
opw-745625
2017-06-07 16:09:16 +02:00
fwi-odoo ad6fd5f838 [REF] web: update bootstrap-datetimepicker lib and adapt datepicker widget
from 3.0.3 to 4.17.42
2017-01-30 10:29:27 +01:00
Cedric Snauwaert 36146b3fad [FIX] web: update moment and datepicker library also add a controller to lazily load locale 2014-08-25 12:11:17 +02:00
Cedric Snauwaert 88dfd62aa5 [FIX] web: remove old datetimepicker and change by bootstrap datetimepicker 2014-08-25 12:11:17 +02:00