ActoKids / AD440_W19_CloudPracticum

3 stars 1 forks source link

Bug: Formatting Date/Time Using React #114

Closed erikNeville closed 5 years ago

erikNeville commented 5 years ago

The format that our "start_date_time" and "end_date_time" fields appear is YYYY-MM-ddThh:mm:ss.000Z. I have been trying to reformat that style, but without much experience with react I am having trouble with displaying that in a proper way.

datetime

That shows the way it looks: 2019-03-20T10:00:00.000Z. I'm trying to format it as March 3, 2019 10:00. I know how to do this without using react, but I'm in need of help on how to do it with react.

hkhual commented 5 years ago

@erikNeville I think you can use pure javascript to convert those timestamp into the format you want. But I found an external library like moment.js, is the best way to convert those timestamps. I was able to format like March 3, 2019 10:00 by using Moment.js. If you want to test it. Here is the link https://momentjs.com/ timestamp-d1

erikNeville commented 5 years ago

Thanks @hkhual , got it working using Momentjs