mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Twix - Add missing 'Hiding Things' properties to TwixFormatOptions interface (#30426)
* Add missing params to TwixFormatOptions * Add examples to twix tests * Add Twix hideYear
This commit is contained in:
parent
15b8963cea
commit
a958c78dd3
7
types/twix/index.d.ts
vendored
7
types/twix/index.d.ts
vendored
@ -23,6 +23,9 @@ export interface TwixFormatOptions {
|
||||
allDay?: any; // boolean | string
|
||||
explicitAllDay?: boolean;
|
||||
lastNightEndsAt?: number;
|
||||
hideTime?: boolean;
|
||||
hideDate?: boolean;
|
||||
hideYear?: boolean;
|
||||
}
|
||||
|
||||
export interface TwixParseAndFormatOptions extends TwixFormatOptions {
|
||||
@ -61,8 +64,8 @@ export interface Twix {
|
||||
overlaps(other: Twix): boolean;
|
||||
engulfs(other: Twix): boolean;
|
||||
equals(other: Twix): boolean;
|
||||
union(other: Twix): Twix;
|
||||
intersection(other: Twix): Twix;
|
||||
union(other: Twix): Twix;
|
||||
intersection(other: Twix): Twix;
|
||||
|
||||
xor(other: Twix): Twix[];
|
||||
difference(other: Twix): Twix[];
|
||||
|
||||
@ -222,4 +222,24 @@ t.format(); //=> Jan 25, 1982, 9:30 AM - 1:30 PM
|
||||
|
||||
t.isSame("day"); //=> true
|
||||
t.humanizeLength(); //=> "4 hours"
|
||||
t.count("days"); //=> 1
|
||||
t.count("days"); //=> 1
|
||||
|
||||
|
||||
var t = moment("2012-05-25T8:00").twix("2012-05-27T17:00");
|
||||
|
||||
t.format({ hideTime: true }); //=> May 25 - 27, 2012
|
||||
|
||||
|
||||
var t = moment("2012-05-25T8:00").twix("2012-05-25T17:00");
|
||||
|
||||
t.format({ hideDate: true }); //=> 8 AM - 5 PM
|
||||
|
||||
|
||||
var t = moment("2012-01-25").twix("2012-01-25", { allDay: true });
|
||||
|
||||
t.format({ hideDate: true }); //=> All day
|
||||
|
||||
|
||||
var t = moment("2012-05-25").twix("2012-05-27");
|
||||
|
||||
t.format({ hideYear: true }); //=> May 25 - May 27
|
||||
Loading…
Reference in New Issue
Block a user