Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#59052 [luxon] Add method toUnixInteger to …
Browse files Browse the repository at this point in the history
…DateTime object by @martin-badin
  • Loading branch information
martin-badin authored Mar 2, 2022
1 parent e442e88 commit 70994de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion types/luxon/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for luxon 2.0
// Type definitions for luxon 2.3
// Project: https://github.com/moment/luxon#readme
// Definitions by: Colby DeHart <https://github.com/colbydehart>
// Hyeonseok Yang <https://github.com/FourwingsY>
Expand All @@ -11,6 +11,7 @@
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Carson Full <https://github.com/carsonf>
// Hugo Silva <https://github.com/hugofpsilva>
// Martin Badin <https://github.com/martin-badin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export * from './src/luxon';
Expand Down
5 changes: 5 additions & 0 deletions types/luxon/src/datetime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,11 @@ export class DateTime {
*/
toSeconds(): number;

/**
* Returns the epoch seconds (as a whole number) of this DateTime.
*/
toUnixInteger(): number;

/**
* Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.
*/
Expand Down
1 change: 1 addition & 0 deletions types/luxon/test/luxon-tests.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ dt.toSQLTime({ includeOffset: false, includeZone: true }); // $ExpectType string
dt.valueOf(); // $ExpectType number
dt.toObject(); // $ExpectType ToObjectOutput
dt.toObject({ includeConfig: true }); // $ExpectType ToObjectOutput
dt.toUnixInteger(); // $ExpectType number

// $ExpectType string | null
dt.toRelative({
Expand Down

0 comments on commit 70994de

Please sign in to comment.