openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.ui.core.format.DateFormat: Format with pattern results sometimes in an incorrect return value

Open 1o4 opened this issue 7 years ago • 3 comments

OpenUI5 version: latest (1.61.2)

Browser/version (+device/version): Chrome latest

Any other tested browsers/devices(OK/FAIL): nope

URL (minimal example if possible): eg.g https://openui5.hana.ondemand.com/#/sample/sap.ui.core.sample.TypeDateAsDate/preview

Steps to reproduce the problem:

  1. start console with statement: sap.ui.core.format.DateFormat.getDateInstance({pattern: "YYYYMMdd", strictParsing:true}).format(new Date("Jan 01 2006"));
  2. Expected result: 20060101
  3. What happens instead: 20050101

Any other information? (attach screenshot if possible) image

1o4 avatar Jan 29 '19 10:01 1o4

You need yyyy instead of YYYY because of the way calendar weeks are taken

For more details https://github.com/SAP/openui5/issues/2370

stephania87 avatar Jan 29 '19 11:01 stephania87

You need yyyy instead of YYYY because of the way calendar weeks are taken

For more details #2370

i see, i see -> rtfm, thanks and sorry for the inconvenience

1o4 avatar Jan 29 '19 12:01 1o4

no problem :)

stephania87 avatar Jan 29 '19 13:01 stephania87