Skip to content

Commit

Permalink
Merge branch 'release/1.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew committed Jan 13, 2020
2 parents a4a8918 + e05b91f commit 4328d00
Show file tree
Hide file tree
Showing 63 changed files with 7,005 additions and 5,054 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
env:
browser: true
commonjs: true
es6: true
extends:
- airbnb-base
- plugin:jest/style
- plugin:jest/recommended
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 2018
rules:
"jest/consistent-test-it": error
plugins:
- jest
3 changes: 0 additions & 3 deletions .jshintrc

This file was deleted.

32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,49 @@ npm install [-g] @drewsonne/maya-dates
const mayaDates = require('@drewsonne/maya-dates')
// Long Count from Initial Series on east side of Stele E, Quirigua
let lc = new mayaDates.factory.LongCountFactory().parse('9.17.0.0.0')
console.log(`${lc.build_full_date()}`)
console.log(`${lc.buildFullDate()}`)
```
This should print `13 Ajaw 18 Kumk'u 9.17. 0. 0. 0`.

## Instructions

Most implementations will consist of creating a date, and passing it to an operation.
Most implementations will consist of creating a fullDate, and passing it to an operation.

### Date Creation
Creating a date can be done either by:
Creating a fullDate can be done either by:

- using a factory class ([LongCountFactory](https://drewsonne.github.io/maya-dates/class/src/factory/long-count.js~LongCountFactory.html),
- using a factory class ([LongCountFactory](https://drewsonne.github.io/maya-dates/class/src/factory/long-count.js~LongCountFactory.html),
[CalendarRoundFactory](https://drewsonne.github.io/maya-dates/class/src/factory/calendar-round.js~CalendarRoundFactory.html),
[FullDateFactory](https://drewsonne.github.io/maya-dates/class/src/factory/full-date.js~FullDateFactory.html))
and calling its `parse(raw_string)` function, where `raw_string` is a LC, CR,
[FullDateFactory](https://drewsonne.github.io/maya-dates/class/src/factory/full-date.js~FullDateFactory.html))
and calling its `parse(raw_string)` function, where `raw_string` is a LC, CR,
or CR and LC combination encoded as a string. To specify missing values in a
date, using `*`. For example,
fullDate, using `*`. For example,
```javascript
const wildcard = mayadates.wildcard

let partial_lc = new mayadates.factory.LongCountFactory().parse('9.17.0.0.*')
let partial_cr = new mayadates.factory.CalendarRoundFactory().parse('13 Ajaw * Kumk\'u')
let partial_date = new mayadates.factory.FullDateFactory().parse('13 Ajaw * Kumk\'u 9.17.0.0.*')

console.log(`LC: ${partial_lc.k_in === wildcard}`)
console.log(`LC: ${partial_lc.kIn === wildcard}`)
console.log(`CR: ${partial_cr.haab.coeff === wildcard}`)
console.log(`Full Date: ${partial_date.lc.k_in === wildcard}`)
console.log(`Full Date: ${partial_date.lc.kIn === wildcard}`)
```

- passing explicit values into a model class ([LongCount](https://drewsonne.github.io/maya-dates/class/src/lc/long-count.js~LongCount.html),
[CalendarRound](https://drewsonne.github.io/maya-dates/class/src/cr/calendar-round.js~CalendarRound.html),

- passing explicit values into a model class ([LongCount](https://drewsonne.github.io/maya-dates/class/src/lc/long-count.js~LongCount.html),
[CalendarRound](https://drewsonne.github.io/maya-dates/class/src/cr/calendar-round.js~CalendarRound.html),
FullDate).

### Operations
Once a date object has been created, you can either add an integer to a date
Once a fullDate object has been created, you can either add an integer to a fullDate
using `shift(number)`, or filling in missing values in wildcards. The
[`operations`](https://drewsonne.github.io/maya-dates/identifiers.html#operations)
namespace provides operators to expand a date with a wildcard into all possible
namespace provides operators to expand a fullDate with a wildcard into all possible
values for dates matching that wildcard pattern.

## Documentation

Full documentation and reference can be found at
Full documentation and reference can be found at
[https://drewsonne.github.io/maya-dates/](https://drewsonne.github.io/maya-dates/).

Loading

0 comments on commit 4328d00

Please sign in to comment.