dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

Strange behaviour of CustomParseFormat

Open shadoworion opened this issue 7 months ago • 0 comments

Describe the bug https://stackblitz.com/edit/dayjs-playground-fqlmkfif?file=index.js

dayjs('09/01/2024 0:01', [
              'YYYY-MM-DD HH:mm:ss.SSS',
              'YYYY-MM-DD HH:mm:ss',
              'YYYY-MM-DD HH:mm',
              'DD/MM/YYYY H:mm:ss.SSS',
              'DD/MM/YYYY H:mm:ss',
              'DD/MM/YYYY H:mm',
              'DD/MM/YYYY HH:mm:ss.SSS',
              'DD/MM/YYYY HH:mm:ss',
              'DD/MM/YYYY HH:mm',
]).format('DD/MM/YYYY HH:mm:ss')
'09/01/2024 0:01'  --> 01/01/2024 00:00:00

P.S. When I remove 'YYYY-MM-DD ***' formats, it works.

Expected behavior

'09/01/2024 0:01'  --> 09/01/2024 00:01:00

Information

  • Day.js Version: 1.11.13
  • OS: MacOS 15.5
  • Browser: Edge 137.0.3296.68
  • Time zone: UTC+2

shadoworion avatar Jun 09 '25 13:06 shadoworion