fix: invalid dates
This commit is contained in:
1 parent
facb1081c9
commit
0d08df2ad5
7 files changed
+23
-19
No files matched your search
@@ -1,2 +1,9 @@
|
||||
export const publishedToDate = (published: string) =>
|
||||
published.endsWith('Z') ? new Date(published) : new Date(`${published}Z`)
|
||||
export const publishedToDate = (published: string): Date => {
|
||||
console.log(published)
|
||||
published.endsWith('Z')
|
||||
? console.log('includes a z. Not doing anything.')
|
||||
: console.log("doesn't include a z. adding it.")
|
||||
return published.endsWith('Z')
|
||||
? new Date(published)
|
||||
: new Date(`${published}Z`)
|
||||
}
|
||||
Reference in new issue
Block a user