mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #8734 from marinewater/master
Add missing type in argument for fromnow
This commit is contained in:
@@ -6,6 +6,10 @@ function dateOnly() {
|
||||
fromnow( '2015-12-31' );
|
||||
}
|
||||
|
||||
function dateObjectOnly() {
|
||||
fromnow( new Date() );
|
||||
}
|
||||
|
||||
function maxChunks() {
|
||||
fromnow( '2015-12-31', {
|
||||
maxChunks: 12
|
||||
@@ -22,4 +26,4 @@ function useAnd() {
|
||||
fromnow( '2015-12-31', {
|
||||
useAnd: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
4
fromnow/fromnow.d.ts
vendored
4
fromnow/fromnow.d.ts
vendored
@@ -12,13 +12,13 @@ declare namespace FromNow {
|
||||
export interface FromNowStatic {
|
||||
/**
|
||||
* Get readable time differences from now vs past or future dates.
|
||||
* @param {string} date
|
||||
* @param {string|Date} date
|
||||
* @param {object} [opts]
|
||||
* @param {number} [opts.maxChucks=10]
|
||||
* @param {boolean} [opts.useAgo=false]
|
||||
* @param {boolean} [opts.useAnd=false]
|
||||
*/
|
||||
(date: string, opts?: FromNowOpts): string
|
||||
(date: string|Date, opts?: FromNowOpts): string
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user