Open emmanuel-receeve opened 1 month ago
There seems to be a bug in date library (version: 0.3.3) that is used for date parsing. For example, if you have handlebars template:
{{date dateVariable "DD.MM.YYYY, HH:mm:ss"}}
This will produce following results: | dateVariable | Result |
---|---|---|
2024-07-29 | 29.07.2024, 00:00:00 | |
2024-07-30 | Invalid date | |
2024-07-31 | 01.08.2024, 00:00:00 | |
2024-07-32 | 30.09.2024, 20:24:00 |
You can disable date library by setting the parameter datejs=false:
{{date dateVariable "DD.MM.YYYY, HH:mm:ss" datejs=false}}
This will produce following results: | dateVariable | Result |
---|---|---|
2024-07-29 | 29.07.2024, 00:00:00 | |
2024-07-30 | 30.07.2024, 00:00:00 | |
2024-07-31 | 31.07.2024, 00:00:00 | |
2024-07-32 | Invalid date |
Note that, in this case, new Date() will be used to parse the date string.
There is an issue with the date function handler in the handlesbar-helpers. It fails for all dates with days above the 29th (for example, 2024-06-30, 2024-07-31) return "invalid date". tested this here https://codesandbox.io/p/sandbox/dank-butterfly-j7dhfz