Skip to content

Commit b3f42c8

Browse files
vishalshrm539Sharma
andauthored
Fix dates formatting (#449)
Co-authored-by: Sharma <[email protected]>
1 parent e65a82b commit b3f42c8

File tree

1 file changed

+2
-4
lines changed
  • packages/react-sdk-components/src/components/helpers/formatters

1 file changed

+2
-4
lines changed

packages/react-sdk-components/src/components/helpers/formatters/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ function getDateObject(text): Date {
1818
const day = parseInt(timeStamp.substr(6, 2), 10);
1919

2020
const date = new Date();
21-
22-
date.setDate(day);
23-
date.setMonth(month);
24-
date.setFullYear(year);
21+
// Fix to handle all the dates, raised via https://github.com/pegasystems/react-sdk-components/issues/442
22+
date.setFullYear(year, month, day);
2523

2624
if (isDateTime) {
2725
const hours = parseInt(timeStamp.substr(9, 2), 10);

0 commit comments

Comments
 (0)