mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 13:27:15 +08:00
30 lines
400 B
TypeScript
30 lines
400 B
TypeScript
|
|
|
|
import fromnow = require( 'fromnow' );
|
|
|
|
function dateOnly() {
|
|
fromnow( '2015-12-31' );
|
|
}
|
|
|
|
function dateObjectOnly() {
|
|
fromnow( new Date() );
|
|
}
|
|
|
|
function maxChunks() {
|
|
fromnow( '2015-12-31', {
|
|
maxChunks: 12
|
|
});
|
|
}
|
|
|
|
function useAgo() {
|
|
fromnow( '2015-12-31', {
|
|
useAgo: true
|
|
});
|
|
}
|
|
|
|
function useAnd() {
|
|
fromnow( '2015-12-31', {
|
|
useAnd: true
|
|
});
|
|
}
|