luka-era-date
v1.2.5
Published
A year-week calendar with epoch to the birthday of Luka Megurine
Downloads
6
Maintainers
Readme
Luka-Era Date
A year-week calendar with epoch to the birthday of Luka Megurine.
Who is Luka Megurine
See Vocaloid CV03 And Luka V4X
About Luka-Era Date and Year-Week Calendar
The Luka-Era Date (LE-Date) consist of 4 parts as:
LE{YEAR}{WEEK}{DAY}
, for example:LE6005
The
LE
stands forLuka-Era
Field
{YEAR}
starts from 2009 which numbered as 0Field
{WEEK}
starts from the week of dateJan 30
, numbered as 0Field
{DAY}
starts from Sunday numbered as 0The day before
Jan 30
counts in the 52th week if they're in the same week, andJan 30
resets the week number to 0, it means that week has two different week numbers before and afterJan 30
LE
or{DAY}
fields can be omitted for abbreviating asLE{Year}{Week}
or simply{YEAR}{WEEK}
Installation
npm install -g luka-era-date
Usage
Usage: luka-era-date [OPTIONS] [YYYY-MM-DD] ...
Convert datetime to Luka-Era date
Options:
-l --ledate LEDATE Get original datetime from LEDATE
-h --help Print this message
API
var LukaEraDate = require('luka-era-date'),
date1 = new LukaEraDate(), // use current datetime
date2 = new LukaEraDate( new Date('2015-01-30T00:00:00Z') ), // use specific date
date3 = LukaEraDate.parse('LE6005') // use LE-Date string
date4 = LukaEraDate.parse('6005') // or its abbreviation
;
console.log( date1.toString() ); // to string prefixed with 'LE'
console.log( date2.valueOf() ); // to number consist of year + week + day
console.log( String( date3 )); // the same as .toString()
console.log( Number( date4 )); // the same as .valueOf()
License
The MIT License (MIT)
Copyright (c) 2009-2017, Nystearia [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.