From 5b74e307f272fb85bbc358aa74b8c9b2e768066d Mon Sep 17 00:00:00 2001 From: Andreas Holstenson Date: Fri, 4 Oct 2019 18:41:26 +0200 Subject: [PATCH] feat: Use DateInterval to represent date intervals --- package-lock.json | 6 +++--- package.json | 2 +- src/time/date-intervals.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index e0e1b6c..af97f56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1324,9 +1324,9 @@ "integrity": "sha512-2RhmH/sjDSCYW2F3ZQxOUx/I7PvzXpi89aQL2d3OAxSTwLx6NilATeUbe0menFE3Lu5lFkOFci36ivimwYHHxw==" }, "datetime-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/datetime-types/-/datetime-types-0.2.0.tgz", - "integrity": "sha512-4ZzJh2Ro5271i78hwjsIA7ZlEJJFE5npElEJY8Eu4Ph3J3xQq0s8/1gsCwkfAvz+3NlonPfizTUSpTNErYfMfQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/datetime-types/-/datetime-types-0.3.0.tgz", + "integrity": "sha512-4KpNOdH0SMbzumtHTAwaq/zRIKy1NGmU7ltqDx+3v6caho3yyKGEpJQ21g/akoQyOZ3YjPMipf/BoidhChM9uQ==", "requires": { "date-fns": "^2.4.1" } diff --git a/package.json b/package.json index 781caeb..dae1f8f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "date-fns": "^2.4.1", - "datetime-types": "^0.2.0", + "datetime-types": "^0.3.0", "fast-clone": "^1.5.13", "fast-deep-equal": "^3.0.0-beta.2", "numeric-types": "^0.3.1", diff --git a/src/time/date-intervals.ts b/src/time/date-intervals.ts index a8927b0..4b35f1a 100644 --- a/src/time/date-intervals.ts +++ b/src/time/date-intervals.ts @@ -6,7 +6,7 @@ import { IntervalData } from './IntervalData'; import { DateTimeData } from './DateTimeData'; import { IntervalEdge } from './IntervalEdge'; import { TimeRelationship } from './TimeRelationship'; -import { Interval, LocalDate } from 'datetime-types'; +import { DateInterval } from 'datetime-types'; /** * Create an interval that matches dates in the past. @@ -48,7 +48,7 @@ function applyRelationAndEdge(r: DateTimeData, edge: IntervalEdge) { return r; } -export function mapDateInterval(r: IntervalData, e: DateTimeEncounter): Interval { +export function mapDateInterval(r: IntervalData, e: DateTimeEncounter): DateInterval { let start = null; let end = null; @@ -78,5 +78,5 @@ export function mapDateInterval(r: IntervalData, e: DateTimeEncounter): Interval } } - return Interval.between(start, end); + return DateInterval.between(start, end); }