Files
odoo_source/addons/web/static/tests/core
Bruno Boi 48511c148e [FIX] web: make a parse smart date test pass
- Name of the test
"utils > dates > parse smart date input"

- Before this commit
The test makes a comparison between the result of parse utils,
which yields luxon's DateTime objects in the user's local TZ
(patched by default to UTC+1 in the testing env), and locally
created DateTime objects in UTC.
This has no sense to compare a date in UTC with another in UTC+1.
The test was thus failing when ran between 11pm and 0am.

- After this commit
The test has been refactored.
Also, even if it has no impact on the parsing result, the local function
parseSmartDateInput now use a DateTime object in local TZ.
This has been done in order to avoid future confusion.
If you're wondering why it has no impact, it is because this function is
used in parseDate(Time), which always sets the local TZ at the end:
```
const a = {
  foo: luxon.DateTime.local(),
  bar: luxon.DateTime.utc(),
};
a.foo.equals(a.bar.setZone("default")); // true
```

closes odoo/odoo#99616

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-06 21:24:01 +02:00
..
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00