Skip to content

Commit

Permalink
fix: jest warning value provided is not in a recognized RFC2822 or IS…
Browse files Browse the repository at this point in the history
…O format. (#553)
  • Loading branch information
aviv1620 authored Mar 10, 2024
1 parent 9f66135 commit b30089f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/api/gapsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export function parseTime(time: 'null'): null
export function parseTime(time: Exclude<string, 'null'>): Moment

export function parseTime(time: string): Moment | null {
if (time == 'null') return null

const utcMoment: Moment = moment.utc(time).tz('Asia/Jerusalem')
if (time !== 'null' && utcMoment.isValid()) {
return utcMoment
} else {
return null
}

if (!utcMoment.isValid()) return null

return utcMoment
}

const USE_API = true
Expand Down

0 comments on commit b30089f

Please sign in to comment.