Skip to content

【WIP】去年/先月/午後。まだ破壊的変更頻繁にあります。

Notifications You must be signed in to change notification settings

TheTeamJ/date-expressions-v4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

date-expressions-v4

Node.js CI

https://scrapbox.io/teamj/date-expressions_(v4)

Usage

const DateExp = require('@daiiz/date-expressions')

const dateExp = new DateExp('去年の8月', 'Asia/Tokyo')
const ranges = dateExp.resolve().dateRanges
// [
//   [ 2019-07-31T15:00:00.000Z, 2019-08-31T14:59:59.999Z ]
// ]

Examples

Usage: analyze query expressions

const { handled, unhandled } = DateExp.analyzeExpression('夏/インターンシップ/午後', '/')
// handled: ['夏', '午後']
// unhandled: ['インターンシップ']

Examples

Dev: Run examples

$ TZ=UTC DEBUG=* node examples.js
$ DEBUG=* TEXT="2001年/2月/午後" node examples.js

Dev: test

$ npm run test:mocha

About

【WIP】去年/先月/午後。まだ破壊的変更頻繁にあります。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published