From 920c99483e8a7e46512a622e70c07467afb418b1 Mon Sep 17 00:00:00 2001 From: Koen Woortman Date: Mon, 21 Jan 2019 14:37:49 +0100 Subject: [PATCH] Add fromSeconds and toSeconds to luxon --- types/luxon/index.d.ts | 2 ++ types/luxon/luxon-tests.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index 3ace54ca0a..3e941585a6 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -144,6 +144,7 @@ declare module 'luxon' { text: string, options?: DateTimeOptions ): DateTime; + static fromSeconds(seconds: number, options?: DateTimeOptions): DateTime; static fromSQL(text: string, options?: DateTimeOptions): DateTime; static fromFormat( text: string, @@ -261,6 +262,7 @@ declare module 'luxon' { toRelative(options?: ToRelativeOptions): string | null; toRelativeCalendar(options?: ToRelativeCalendarOptions): string | null; toRFC2822(): string; + toSeconds(): number; toSQL(options?: ToSQLOptions): string; toSQLDate(): string; toSQLTime(options?: ToSQLOptions): string; diff --git a/types/luxon/luxon-tests.ts b/types/luxon/luxon-tests.ts index 133b220cb2..6ee6eb87be 100644 --- a/types/luxon/luxon-tests.ts +++ b/types/luxon/luxon-tests.ts @@ -39,6 +39,7 @@ dt.toLocaleString(); dt.toLocaleString(DateTime.DATE_MED); dt.toISO(); dt.toISO({includeOffset: true}); +dt.toSeconds(); dt.toSQL(); dt.toSQL({includeOffset: false, includeZone: true}); dt.toSQLDate();