Skip to content

Commit 25a52d4

Browse files
committed
make CveDate and IsoDateString deprecated. Code using it will be updated in a later sprint
1 parent 5e8c6e4 commit 25a52d4

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/common/IsoDate/IsoDateString.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*
66
* Note that in the future, if necessary, we can extend what this class covers, but for now
77
* this strict and opinionated set is very useful for processing ISO Date+Time+TZ strings
8+
*
9+
* @deprecated Use IsoDatetime or IsoDate instead for safer and more efficient datetime and date functions
810
*/
911

1012
/** a regular expression to represent an ISO Date+Time+TZ string

src/date/CveDate.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
import {
2+
differenceInSeconds,
3+
// endOfYesterday,
4+
// startOfToday,
5+
// startOfYesterday,
6+
sub
7+
} from 'date-fns';
8+
import { formatInTimeZone } from 'date-fns-tz';
9+
import { IsoDateString } from '../common/IsoDate/IsoDateString.js';
10+
111
/**
212
* Date utility and class to
313
* - facilitate using dates in CveRecords and Javascript, standardizing all dates to
@@ -16,19 +26,10 @@
1626
* Throughout this class, we will use
1727
* - jsDate to represent a standard JS Date object
1828
* - isoDateStr to represent an ISO/UTC/Z date string (e.g. 2023-03-29T00:00:00.000Z)
29+
*
30+
* @deprecated Use IsoDatetime or IsoDate instead for safer and more efficient datetime and date functions
1931
*/
2032

21-
22-
import {
23-
differenceInSeconds,
24-
// endOfYesterday,
25-
// startOfToday,
26-
// startOfYesterday,
27-
sub
28-
} from 'date-fns';
29-
import { formatInTimeZone } from 'date-fns-tz';
30-
import { IsoDateString } from '../common/IsoDate/IsoDateString.js';
31-
3233
export class CveDate {
3334

3435
/** the Date object this CveDate instance wraps */

0 commit comments

Comments
 (0)