Skip to content

Commit

Permalink
feat(luxon): Use DateTime.isDateTime instead of instanceof (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-kuck committed Jul 23, 2023
1 parent 2cd6e75 commit 24f0ded
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/luxon/src/luxon-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class LuxonUtils implements IUtils<DateTime> {
return DateTime.fromJSDate(new Date(value), { locale: this.locale });
}

if (value instanceof DateTime) {
if (DateTime.isDateTime(value)) {
return value;
}

Expand Down Expand Up @@ -134,7 +134,7 @@ export default class LuxonUtils implements IUtils<DateTime> {
};

public isValid = (value: any) => {
if (value instanceof DateTime) {
if (DateTime.isDateTime(value)) {
return value.isValid;
}

Expand Down

0 comments on commit 24f0ded

Please sign in to comment.