mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-03 23:42:50 +00:00
add parse-human-date-range
This commit is contained in:
parent
547098699c
commit
fa5fc0385f
8
types/parse-human-date-range/index.d.ts
vendored
Normal file
8
types/parse-human-date-range/index.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// Type definitions for parse-human-date-range 1.0
|
||||
// Project: https://github.com/niksy/parse-human-date-range#readme
|
||||
// Definitions by: Emily Marigold Klassen <https://github.com/forivall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = parse;
|
||||
|
||||
declare function parse(input: string, offset?: Date): Date[];
|
||||
27
types/parse-human-date-range/parse-human-date-range-tests.ts
Normal file
27
types/parse-human-date-range/parse-human-date-range-tests.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import parse = require('parse-human-date-range');
|
||||
|
||||
parse('last 2 days');
|
||||
/* [
|
||||
Sat Oct 15 2016 14:00:00 GMT+0200 (CEST),
|
||||
Sun Oct 16 2016 14:00:00 GMT+0200 (CEST)
|
||||
] */
|
||||
|
||||
parse('next 2 weeks');
|
||||
/* [
|
||||
Tue Oct 18 2016 14:00:00 GMT+0200 (CEST),
|
||||
Wed Oct 19 2016 14:00:00 GMT+0200 (CEST),
|
||||
Thu Oct 20 2016 14:00:00 GMT+0200 (CEST),
|
||||
Fri Oct 21 2016 14:00:00 GMT+0200 (CEST),
|
||||
Sat Oct 22 2016 14:00:00 GMT+0200 (CEST),
|
||||
Sun Oct 23 2016 14:00:00 GMT+0200 (CEST),
|
||||
Mon Oct 24 2016 14:00:00 GMT+0200 (CEST),
|
||||
...
|
||||
] */
|
||||
|
||||
parse('last 2 tuesdays');
|
||||
/* [
|
||||
Tue Oct 04 2016 14:00:00 GMT+0200 (CEST),
|
||||
Tue Oct 11 2016 14:00:00 GMT+0200 (CEST)
|
||||
] */
|
||||
|
||||
parse('invalid', new Date('2016-10-17T12:00:00.000Z'));
|
||||
23
types/parse-human-date-range/tsconfig.json
Normal file
23
types/parse-human-date-range/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"parse-human-date-range-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/parse-human-date-range/tslint.json
Normal file
1
types/parse-human-date-range/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user