summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/components/datepicker_tests.js
AgeCommit message (Collapse)Author
2021-03-17[FIX] web: compute default locale of Date(Time)Picker at the right timeNasreddin (bon)
Issue - Install "Accounting" - Change user language to arabic - Go to Customer Invoices list view - Try to filter on field "Created On" Traceback is raised from the DatePicker Component Cause The cause is two fold: There is an issue in moment that behaves abnormally when its internals are not able to extract the month in a locale, and, instead of returning an invalid moment, it returns a valid moment with the month set to January which just happens to be the first month of moment's default locale ref: https://github.com/moment/moment/issues/5600 Secondly, the defaultProps "locale" of the DatePicker was set to moment.locale() at the file's initial loading, that is, before any user locale parameters were loaded The bootstrap datepicker was then set with the wrong locale, and the case fell under moment's issue After this commit, the locale of the DatePicker is always the one of the user, and there is no traceback opw-2460156 closes odoo/odoo#67320 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Lucas Perais <lpe@odoo.com>
2020-07-29[FIX] web: datepicker get correct database formatJulien Mougenot
Before this commit, the format used by both date and datetime picker components depended on default props which are evaluated on module loading. This was an issue because the "time" module did not have time to load and fetch the correct database value, hence using the default ones. Now, the format is evaluated on component instantiation, giving enough time to the "time" module to load. Task 2307258 closes odoo/odoo#55113 X-original-commit: 792b565a65a8c9f65bf13e94f30b88913f2bfa7f Signed-off-by: Paul Morelle <madprog@users.noreply.github.com> Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-03-13[REF] web: Control panel testsJulien Mougenot
Use of the new helpers in control panel (and subcomponents) tests and addition of new tests. Part of task 2196029 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>