Skip to content

Commit

Permalink
fix(date-time): Resolved issue with references in constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Dec 17, 2023
1 parent bae1060 commit 8bae7b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"preinstall": "npx -y only-allow pnpm",
"install:csb": "corepack enable && pnpm install --frozen-lockfile",
"lint": "pnpm storm-lint all --skip-cspell",
"local-registry": "nx local-registry @storm-software/storm-stack",
"local-registry": "nx local-registry @storm-stack/monorepo",
"nx": "nx",
"prepare": "pnpm add husky -w && pnpm husky install",
"readme-gen": "pnpm storm-git readme-gen --templates=\"docs/readme-templates\"",
Expand Down
4 changes: 2 additions & 2 deletions packages/date-time/src/storm-date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class StormDate extends StormDateTime {
public constructor(dateTime?: DateTimeInput, options?: DateTimeOptions) {
super(dateTime, options);

this.instant = this.instant
this.instant = super.instant
.toZonedDateTimeISO("UTC")
.with({
hour: 0,
Expand All @@ -68,7 +68,7 @@ export class StormDate extends StormDateTime {
nanosecond: 0
})
.toInstant();
this.zonedDateTime = this.zonedDateTime.with({
this.zonedDateTime = super.zonedDateTime.with({
hour: 0,
minute: 0,
second: 0,
Expand Down
6 changes: 3 additions & 3 deletions packages/date-time/src/storm-time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class StormTime extends StormDateTime {
* @returns A new instance of DateTime with the current date and time.
*/
public static override now(): number {
return StormDateTime.current().epochMilliseconds;
return StormTime.current().epochMilliseconds;
}

/**
Expand Down Expand Up @@ -57,15 +57,15 @@ export class StormTime extends StormDateTime {
public constructor(dateTime?: DateTimeInput, options?: DateTimeOptions) {
super(dateTime, options);

this.instant = this.instant
this.instant = super.instant
.toZonedDateTimeISO("UTC")
.with({
year: 1970,
month: 1,
day: 1
})
.toInstant();
this.zonedDateTime = this.zonedDateTime.with({
this.zonedDateTime = super.zonedDateTime.with({
year: 1970,
month: 1,
day: 1
Expand Down

0 comments on commit 8bae7b0

Please sign in to comment.