GithubHelp home page GithubHelp logo

joaquingatica / elvish-date Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.14 MB

NPM module for Elvish Calendar conversion of dates and utilities

Home Page: https://joaquingatica.github.io/elvish-date/

License: ISC License

JavaScript 100.00%
elvish calendar imladris-reckoning npm date

elvish-date's Introduction

Elvish Date library

npm version

This npm module elvish-date includes the ElvishDate class that mimics the standard JavaScript Date class, but for the Reckoning of Imladris (aka Imladris Calendar or Elvish Calendar).

NPM module for Elvish Calendar conversion of dates and utilities

Elvish Calendar

For information on the Elvish Calendar (Reckoning of Imladris), visit Quenya101: https://quenya101.com/calendar/


Documentation

Find the JSDoc documentation here, or below.

ElvishDate

Kind: global class

new ElvishDate([...args])

constructor()
constructor(Date)
constructor(ElvishDate)
constructor(attributes)
constructor(yen, loa, period[, day])

Param Type
[...args] Date | ElvishDate | Object | number

elvishDate.getYen() ⇒ number

Return number of the Yen (> 0) for the specified date

Kind: instance method of ElvishDate

elvishDate.getYenNumeral() ⇒ string

Returns the roman numerals representation of the Yen for the specified date

Kind: instance method of ElvishDate

elvishDate.getLoa() ⇒ number

Return the number of the Loa (1-144) for the specified date

Kind: instance method of ElvishDate

elvishDate.getPeriod() ⇒ number

Return the number (0-8) of the Period for the specified date

Kind: instance method of ElvishDate

elvishDate.getPeriodName() ⇒ string

Return the name of the Period for the specified date

Kind: instance method of ElvishDate

elvishDate.getDayOfLoa() ⇒ number

Return the number of Day of the Loa (1-based index) for the specified date

Kind: instance method of ElvishDate

elvishDate.getDayOfPeriod() ⇒ number

Return the number of Day of the Period (1-based index, upper limit depends on Period) for the specified date

Kind: instance method of ElvishDate

elvishDate.getDayOfWeek() ⇒ number

Return the number (0-5) of Day of the Week for the specified date

Kind: instance method of ElvishDate

elvishDate.getDayOfWeekName() ⇒ string

Return the name of the Day of the Week for the specified date

Kind: instance method of ElvishDate

elvishDate.getTime() ⇒ number

Returns the numeric value of the specified date as the number of milliseconds since Yestarë, I 1, 00:00:00 (not supported for prior times).

Kind: instance method of ElvishDate

elvishDate.setYen(yen)

Sets the Yen value (> 0) for a specified date

Kind: instance method of ElvishDate

Param Type
yen number

elvishDate.setLoa(loa)

Sets the Loa value (1-144) for a specified date

Kind: instance method of ElvishDate

Param Type
loa number

elvishDate.setPeriod(period)

Sets the Period value (0-8) for a specified date

Kind: instance method of ElvishDate

Param Type
period number

elvishDate.setDayOfPeriod(dayOfPeriod)

Sets the Day of Period value (1-based index, upper limit depends on Period) for a specified date

Kind: instance method of ElvishDate

Param Type
dayOfPeriod number

elvishDate.setTime() ⇒ number

Sets the time in number of milliseconds since Yestarë, I 1, 00:00:00 (>= 0) for a specified date.

Kind: instance method of ElvishDate

elvishDate.toString() ⇒ string

String representation of the specified date.

Kind: instance method of ElvishDate

elvishDate.toDate() ⇒ Date

Get current ElvishDate as Date

Kind: instance method of ElvishDate

ElvishDate.length : number

Number of arguments handled by constructor (4)

Kind: static property of ElvishDate

ElvishDate.periods : Object

Constants for periods
{YESTARE: 0, TUILE: 1, LAIRE: 2, YAVIE: 3, ENDERI: 4, QUELLE: 5, HRIVE: 6, COIRE: 7, METTARE: 8}

Kind: static property of ElvishDate

ElvishDate.daysOfWeek : Object

Constants for days of week
{ELENYA: 0, ANARYA: 1, ISILYA: 2, ALDUYA: 3, MENELYA: 4, VALANYA: 5}

Kind: static property of ElvishDate

ElvishDate.yen(romanNumeral) ⇒ number

Helper for getting number for Roman Numeral of Yen

Kind: static method of ElvishDate

Param Type
romanNumeral string

ElvishDate.fromDate([...args]) ⇒ ElvishDate

Accepts same arguments as the standard Date constructor, or accepts a Date instance
fromDate()
fromDate(int)
fromDate(dateString)
fromDate(year, month[, day[, hours[, minutes[, seconds[, milliseconds]]]]])
fromDate(Date)

Kind: static method of ElvishDate

Param Type
[...args] number | string | Object

ElvishDate.now() ⇒ number

Return the number of milliseconds since time 00:00:00 of Yestarë, I 1 (March 29, 1)

Kind: static method of ElvishDate

elvish-date's People

Contributors

joaquingatica avatar

Stargazers

 avatar

Watchers

 avatar  avatar

elvish-date's Issues

undefined Day of Week

Just noticed another problem. If you try to find the day of week name for 2018-01-12 you will get an undefined day of week name. This repeats every seven days. I guess the class presumes that the week has seven days in it and has no name for the seventh day after Valanya.

Thank you very much for the excellent work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.