-
Notifications
You must be signed in to change notification settings - Fork 1k
date formatting in spfx #4477
Copy link
Copy link
Closed
Labels
area:spfxCategory: SharePoint Framework (not extensions related)Category: SharePoint Framework (not extensions related)status:answeredAnswer to a question.Answer to a question.type:questionQuestion... if answered, will be tagged as such.Question... if answered, will be tagged as such.
Metadata
Metadata
Assignees
Labels
area:spfxCategory: SharePoint Framework (not extensions related)Category: SharePoint Framework (not extensions related)status:answeredAnswer to a question.Answer to a question.type:questionQuestion... if answered, will be tagged as such.Question... if answered, will be tagged as such.
Hi,
Within the first tutorial, you outline how to fetch and display some various columns: text, choices, multiple lines, and booleans. But you don't go over dates.
If I call a date such as Modified date I get:
"2019-08-12T03:19:38Z"
I've made attempts at trying to format this to a simple "MM-dd-YYYY" format but with no luck. I've installed moment.js and tried to format by doing something like:
<div>moment(${item.Modified},"MM-dd-YYYY")</div>in my render method but that doesn't seem to be correct as nothing changes or I literally get the function call as a literal string.Can someone help point me in the right direction as to how this should be handled in Typescript? I'm just very new to this and would appreciate some direction since your documentation doesn't really cover dates and this seems really important.