-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #904 from Deltares/dwo-680-default-period
Use period from display configuration as x-axis domain
- Loading branch information
Showing
5 changed files
with
70 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { expect, test } from 'vitest' | ||
|
||
import { convertFewsPiDateTimeToJsDate } from '.' | ||
|
||
test('parses a FEWS PI date/time object to a Date object without timezone offset', () => { | ||
const fewsDatetime = { date: '2021-07-01', time: '12:00:00' } | ||
const result = convertFewsPiDateTimeToJsDate(fewsDatetime, 'Z') | ||
expect(result).toEqual(new Date('2021-07-01T12:00:00Z')) | ||
}) | ||
|
||
test('parses a FEWS PI date/time object to a Date object with a timezone offset', () => { | ||
const fewsDatetime = { date: '2021-07-01', time: '12:00:00' } | ||
const result = convertFewsPiDateTimeToJsDate(fewsDatetime, '+02:00') | ||
expect(result).toEqual(new Date('2021-07-01T12:00:00+02:00')) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters