mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-08 16:40:30 +08:00
Add object parsing overload to moment setter
This commit is contained in:
Vendored
+2
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Moment.js 2.8.0
|
||||
// Type definitions for Moment.js 2.10.6
|
||||
// Project: https://github.com/timrwood/moment
|
||||
// Definitions by: Michael Lakerveld <https://github.com/Lakerfield>, Aaron King <https://github.com/kingdango>, Hiroki Horiuchi <https://github.com/horiuchi>, Dick van den Brink <https://github.com/DickvdBrink>, Adi Dahiya <https://github.com/adidahiya>, Matt Brooks <https://github.com/EnableSoftware>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -303,6 +303,7 @@ declare module moment {
|
||||
|
||||
get(unit: string): number;
|
||||
set(unit: string, value: number): Moment;
|
||||
set(input: MomentInput): Moment;
|
||||
}
|
||||
|
||||
type formatFunction = () => string;
|
||||
|
||||
@@ -127,6 +127,15 @@ moment().isoWeeks(45);
|
||||
moment().dayOfYear();
|
||||
moment().dayOfYear(45);
|
||||
|
||||
moment().set('year', 2013);
|
||||
moment().set('month', 3); // April
|
||||
moment().set('date', 1);
|
||||
moment().set('hour', 13);
|
||||
moment().set('minute', 20);
|
||||
moment().set('second', 30);
|
||||
moment().set('millisecond', 123);
|
||||
moment().set({'year': 2013, 'month': 3});
|
||||
|
||||
var getMilliseconds: number = moment().milliseconds();
|
||||
var getSeconds: number = moment().seconds();
|
||||
var getMinutes: number = moment().minutes();
|
||||
|
||||
Reference in New Issue
Block a user