scdate 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export * from './constants';
2
- export * from './sDate';
3
- export * from './sTime';
4
- export * from './sTimestamp';
5
- export * from './sWeekdays';
6
- export type * from './internal/SDate';
7
- export type * from './internal/STime';
8
- export type * from './internal/STimestamp';
9
- export type * from './internal/SWeekdays';
1
+ export * from './constants.js';
2
+ export * from './sDate.js';
3
+ export * from './sTime.js';
4
+ export * from './sTimestamp.js';
5
+ export * from './sWeekdays.js';
6
+ export type * from './internal/SDate.js';
7
+ export type * from './internal/STime.js';
8
+ export type * from './internal/STimestamp.js';
9
+ export type * from './internal/SWeekdays.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * from './constants';
2
- export * from './sDate';
3
- export * from './sTime';
4
- export * from './sTimestamp';
5
- export * from './sWeekdays';
1
+ export * from './constants.js';
2
+ export * from './sDate.js';
3
+ export * from './sTime.js';
4
+ export * from './sTimestamp.js';
5
+ export * from './sWeekdays.js';
@@ -1,4 +1,4 @@
1
- import { validateISODate } from './date';
1
+ import { validateISODate } from './date.js';
2
2
  export class SDate {
3
3
  date;
4
4
  constructor(isoValue) {
@@ -1,4 +1,4 @@
1
- import { validateISOTime } from './time';
1
+ import { validateISOTime } from './time.js';
2
2
  export class STime {
3
3
  time;
4
4
  constructor(isoValue) {
@@ -1,4 +1,4 @@
1
- import { validateISOTimestamp } from './timestamp';
1
+ import { validateISOTimestamp } from './timestamp.js';
2
2
  export class STimestamp {
3
3
  timestamp;
4
4
  constructor(timestamp) {
@@ -1,4 +1,4 @@
1
- import { validateWeekdays } from './weekdays';
1
+ import { validateWeekdays } from './weekdays.js';
2
2
  export class SWeekdays {
3
3
  weekdays;
4
4
  constructor(weekdays) {
@@ -1,4 +1,4 @@
1
- import { Weekday } from '../constants';
1
+ import { Weekday } from '../constants.js';
2
2
  export declare const DayToWeekday: Weekday[];
3
3
  export declare const DaysInWeek = 7;
4
4
  export declare const MinutesInDay = 1440;
@@ -1,4 +1,4 @@
1
- import { Weekday } from '../constants';
1
+ import { Weekday } from '../constants.js';
2
2
  export const DayToWeekday = [
3
3
  Weekday.Sun,
4
4
  Weekday.Mon,
@@ -1,5 +1,5 @@
1
1
  import { UTCDateMini } from '@date-fns/utc';
2
- import { SDate } from './SDate';
2
+ import { SDate } from './SDate.js';
3
3
  export declare const getISOYearFromISODate: (isoDate: string) => string;
4
4
  export declare const getISOMonthFromISODate: (isoDate: string) => string;
5
5
  export declare const getISODateFromISODate: (isoDate: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { UTCDateMini } from '@date-fns/utc';
2
- import { STimestamp } from './STimestamp';
2
+ import { STimestamp } from './STimestamp.js';
3
3
  export declare const getISODateFromISOTimestamp: (isoTimestamp: string) => string;
4
4
  export declare const getISOTimeFromISOTimestamp: (isoTimestamp: string) => string;
5
5
  export declare const getISOTimestampFromZonedDate: (date: Date) => string;
@@ -1,6 +1,6 @@
1
1
  import { UTCDateMini } from '@date-fns/utc';
2
- import { getISODateFromZonedDate, validateISODate } from './date';
3
- import { getISOTimeFromDate, validateISOTime } from './time';
2
+ import { getISODateFromZonedDate, validateISODate } from './date.js';
3
+ import { getISOTimeFromDate, validateISOTime } from './time.js';
4
4
  export const getISODateFromISOTimestamp = (isoTimestamp) => {
5
5
  const EndOfDateIndex = 10;
6
6
  return isoTimestamp.slice(0, EndOfDateIndex);
@@ -1,3 +1,3 @@
1
- import { Weekday } from '../constants';
1
+ import { Weekday } from '../constants.js';
2
2
  export declare const validateWeekdays: (weekdays: string) => void;
3
3
  export declare const getIndexForWeekday: (weekday: Weekday) => number;
@@ -1,4 +1,4 @@
1
- import { DayToWeekday } from './constants';
1
+ import { DayToWeekday } from './constants.js';
2
2
  export const validateWeekdays = (weekdays) => {
3
3
  const ValidWeekdays = /^[S-][M-][T-][W-][T-][F-][S-]$/;
4
4
  if (!ValidWeekdays.test(weekdays)) {
@@ -1,5 +1,5 @@
1
- import { SDate } from './SDate';
2
- import { STimestamp } from './STimestamp';
1
+ import { SDate } from './SDate.js';
2
+ import { STimestamp } from './STimestamp.js';
3
3
  export declare const getMillisecondsInUTCFromTimestamp: (timestamp: STimestamp, timeZone: string) => number;
4
4
  export declare const getMillisecondsInUTCFromDate: (date: SDate, timeZone: string) => number;
5
5
  export declare const getTimeZonedDate: (millisecondsInUTC: number, timeZone: string) => Date;
@@ -1,6 +1,6 @@
1
1
  import { getTimezoneOffset, toZonedTime } from 'date-fns-tz';
2
- import { getDateAsUTCDateMini } from './date';
3
- import { getTimestampAsUTCDateMini } from './timestamp';
2
+ import { getDateAsUTCDateMini } from './date.js';
3
+ import { getTimestampAsUTCDateMini } from './timestamp.js';
4
4
  const getValidatedTimeZoneOffset = (timeZone, utcDate) => {
5
5
  const timeZoneOffset = getTimezoneOffset(timeZone, utcDate);
6
6
  if (isNaN(timeZoneOffset)) {
package/dist/sDate.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Weekday } from './constants';
2
- import { SDate } from './internal/SDate';
1
+ import { Weekday } from './constants.js';
2
+ import { SDate } from './internal/SDate.js';
3
3
  export interface SDateShortStringOptions {
4
4
  includeWeekday: boolean;
5
5
  onTodayText: () => string;
package/dist/sDate.js CHANGED
@@ -1,9 +1,9 @@
1
- import { SDate } from './internal/SDate';
2
- import { DayToWeekday, DaysInWeek, MillisecondsInDay, } from './internal/constants';
3
- import { getDateAsUTCDateMini, getISODateFromISODate, getISODateFromZonedDate, getISOMonthFromISODate, getISOYearFromISODate, } from './internal/date';
4
- import { getAtIndex } from './internal/utils';
5
- import { getIndexForWeekday } from './internal/weekdays';
6
- import { getMillisecondsInUTCFromDate, getTimeZonedDate, } from './internal/zoned';
1
+ import { SDate } from './internal/SDate.js';
2
+ import { DayToWeekday, DaysInWeek, MillisecondsInDay, } from './internal/constants.js';
3
+ import { getDateAsUTCDateMini, getISODateFromISODate, getISODateFromZonedDate, getISOMonthFromISODate, getISOYearFromISODate, } from './internal/date.js';
4
+ import { getAtIndex } from './internal/utils.js';
5
+ import { getIndexForWeekday } from './internal/weekdays.js';
6
+ import { getMillisecondsInUTCFromDate, getTimeZonedDate, } from './internal/zoned.js';
7
7
  export const sDate = (date) => {
8
8
  if (date instanceof SDate) {
9
9
  return date;
package/dist/sTime.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { STime } from './internal/STime';
1
+ import { STime } from './internal/STime.js';
2
2
  export declare const sTime: (time: string | STime) => STime;
3
3
  export declare const getTimeNow: (timeZone: string) => STime;
4
4
  export declare const getTimeAtMidnight: () => STime;
package/dist/sTime.js CHANGED
@@ -1,7 +1,7 @@
1
- import { STime } from './internal/STime';
2
- import { MinutesInDay, MinutesInHour } from './internal/constants';
3
- import { getISOHoursFromISOTime, getISOMinutesFromISOTime, getISOTimeFromDate, } from './internal/time';
4
- import { getTimeZonedDate } from './internal/zoned';
1
+ import { STime } from './internal/STime.js';
2
+ import { MinutesInDay, MinutesInHour } from './internal/constants.js';
3
+ import { getISOHoursFromISOTime, getISOMinutesFromISOTime, getISOTimeFromDate, } from './internal/time.js';
4
+ import { getTimeZonedDate } from './internal/zoned.js';
5
5
  export const sTime = (time) => {
6
6
  if (time instanceof STime) {
7
7
  return time;
@@ -1,6 +1,6 @@
1
- import { SDate } from './internal/SDate';
2
- import { STime } from './internal/STime';
3
- import { STimestamp } from './internal/STimestamp';
1
+ import { SDate } from './internal/SDate.js';
2
+ import { STime } from './internal/STime.js';
3
+ import { STimestamp } from './internal/STimestamp.js';
4
4
  export interface STimestampShortStringOptions {
5
5
  includeWeekday: boolean;
6
6
  onTodayAtText: () => string;
@@ -1,9 +1,9 @@
1
- import { STimestamp } from './internal/STimestamp';
2
- import { MillisecondsInMinute, MillisecondsInSecond, } from './internal/constants';
3
- import { getISODateFromISOTimestamp, getISOTimeFromISOTimestamp, getISOTimestampFromZonedDate, getTimestampAsUTCDateMini, } from './internal/timestamp';
4
- import { getMillisecondsInUTCFromTimestamp, getTimeZonedDate, } from './internal/zoned';
5
- import { getShortDateString, sDate } from './sDate';
6
- import { get12HourTimeString, sTime } from './sTime';
1
+ import { STimestamp } from './internal/STimestamp.js';
2
+ import { MillisecondsInMinute, MillisecondsInSecond, } from './internal/constants.js';
3
+ import { getISODateFromISOTimestamp, getISOTimeFromISOTimestamp, getISOTimestampFromZonedDate, getTimestampAsUTCDateMini, } from './internal/timestamp.js';
4
+ import { getMillisecondsInUTCFromTimestamp, getTimeZonedDate, } from './internal/zoned.js';
5
+ import { getShortDateString, sDate } from './sDate.js';
6
+ import { get12HourTimeString, sTime } from './sTime.js';
7
7
  export const sTimestamp = (timestamp) => {
8
8
  if (timestamp instanceof STimestamp) {
9
9
  return timestamp;
@@ -1,6 +1,6 @@
1
- import { Weekday } from './constants';
2
- import { SDate } from './internal/SDate';
3
- import { SWeekdays } from './internal/SWeekdays';
1
+ import { Weekday } from './constants.js';
2
+ import { SDate } from './internal/SDate.js';
3
+ import { SWeekdays } from './internal/SWeekdays.js';
4
4
  export declare const sWeekdays: (weekdays: string | SWeekdays) => SWeekdays;
5
5
  export declare const getWeekdaysFromWeekdayFlags: (weekdays: Weekday) => SWeekdays;
6
6
  export declare const getWeekdaysWithAllIncluded: () => SWeekdays;
package/dist/sWeekdays.js CHANGED
@@ -1,8 +1,8 @@
1
- import { SWeekdays } from './internal/SWeekdays';
2
- import { DayToWeekday, DaysInWeek } from './internal/constants';
3
- import { getAtIndex, hasFlag } from './internal/utils';
4
- import { getIndexForWeekday } from './internal/weekdays';
5
- import { addDaysToDate, getDaysBetweenDates, getWeekdayFromDate, isAfterDate, isSameDateOrBefore, sDate, } from './sDate';
1
+ import { SWeekdays } from './internal/SWeekdays.js';
2
+ import { DayToWeekday, DaysInWeek } from './internal/constants.js';
3
+ import { getAtIndex, hasFlag } from './internal/utils.js';
4
+ import { getIndexForWeekday } from './internal/weekdays.js';
5
+ import { addDaysToDate, getDaysBetweenDates, getWeekdayFromDate, isAfterDate, isSameDateOrBefore, sDate, } from './sDate.js';
6
6
  const AllWeekdaysIncludedMask = 'SMTWTFS';
7
7
  const NotIncludedDay = '-';
8
8
  const NoWeekdaysIncluded = NotIncludedDay.repeat(AllWeekdaysIncludedMask.length);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scdate",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"