Skip to content

Commit

Permalink
πŸ› if (date.endsWith('Z')) (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
NatoBoram authored Dec 7, 2023
1 parent edbb68c commit be5841d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/utils/dates.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Duration, durationUnit } from './duration.js'

export function lemmyDate(date: string) {
if (date.endsWith('Z')) return new Date(date)
return new Date(`${date}Z`)
}

Expand Down

0 comments on commit be5841d

Please sign in to comment.