Merge pull request #8734 from marinewater/master

Add missing type in argument for fromnow
This commit is contained in:
Masahiro Wakame
2016-03-30 22:51:04 +09:00
2 changed files with 7 additions and 3 deletions

View File

@@ -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
});
}
}

View File

@@ -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
}
}