Skip to content

Commit

Permalink
Merge pull request #405 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain authored Dec 11, 2023
2 parents a0bb9d0 + b728cd6 commit 1f7102c
Show file tree
Hide file tree
Showing 21 changed files with 2,536 additions and 2,066 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,31 @@ s.i18n({
am: ' a. m.',
pm: ' a. m.'
},
useTitleCase: true // automatically in .format()
distance: {
past: 'past',
future: 'future',
present: 'present',
now: 'now',
almost: 'almost',
over: 'over',
pastDistance: (value) => `${value} ago`,
futureDistance: (value) => `in ${value}`
},
units: {
second: 'second',
secondPlural: 'second',
minute: 'minute',
minutePlural: 'minutes',
hour: 'hour',
hourPlural: 'hours',
day: 'day',
dayPlural: 'seconds',
month: 'month',
monthPlural: 'months',
year: 'year',
yearPlural: 'years',
},
useTitleCase: true // automatically in .format()
});
s.format('day') //'Sábado'
```
Expand Down
212 changes: 146 additions & 66 deletions builds/spacetime.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/spacetime.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/spacetime.mjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ This project follows semVer, where:
-->

### 7.5.0 [Dec 2023]

- **[fix]** - offset in Africa/Cairo #404
- **[update]** - 2024 DST changes
- **[change]** - support i18n config in .since() #403

### 7.4.8 [Oct 2023]

- **[fix]** - fix for reversed-DST in `africa/casablanca` and `africa/el_aaiun` #400
- **[update]** - deps

Expand Down
136 changes: 96 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spacetime",
"version": "7.4.7",
"version": "7.5.0",
"description": "figure-out dates across timezones",
"main": "src/index.js",
"unpkg": "builds/spacetime.min.js",
Expand Down Expand Up @@ -58,7 +58,7 @@
"rollup-plugin-terser": "7.0.2",
"shelljs": "0.8.5",
"tap-dancer": "0.3.4",
"tape": "5.7.1",
"tape": "5.7.2",
"timekeeper": "2.3.1"
},
"license": "Apache-2.0"
Expand Down
36 changes: 20 additions & 16 deletions scratch.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
// const spacetime = require('./builds/spacetime.cjs')
import spacetime from './src/index.js'

let s = spacetime('feb 1st 2023', 'Africa/Casablanca')
console.log(s.timezone().current.offset)
s = spacetime('apr 1st 2023', 'Africa/Casablanca')
console.log(s.timezone().current.offset)
s = spacetime('oct 1st 2023', 'Africa/Casablanca')
console.log(s.timezone().current.offset)

// s = spacetime.now('Europe/Lisbon')
let s = spacetime(null, 'pacific/fiji')
console.log(s.time())
console.log(s.timezone())
// s = s.minus(5, 'months')
// console.log(s.time())
// console.log(s.timezone())

// s = spacetime(null, 'America/Toronto')
// console.log(s.time())
// console.log(s.timezone())

// s = s.year(2020)
// s = s.dayOfYear(366);
// console.log(s.dayTime());

// let s = spacetime('03/31/2002', 'America/Denver')
// console.log(s.iso())

// casablanca is + 1, 0, +1
/*
bahia_banderas
chihuahua
mazatlan
merida
mexico_city
monterrey
amman
damascus
tehran
fiji
*/
2 changes: 1 addition & 1 deletion scripts/updateZonefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sh from 'shelljs'
sh.config.silent = true
import data from '../zonefile/iana.js'
import { writeFileSync } from 'fs'
const year = 2023//new Date().getFullYear()
const year = 2024 //new Date().getFullYear()
// /usr/share/zoneinfo only stores changes, and will use the most-recent change
// see /usr/share/zoneinfo/Africa/Algiers - has changes scheduled for 2038

Expand Down
2 changes: 1 addition & 1 deletion src/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '7.4.7'
export default '7.5.0'
Loading

0 comments on commit 1f7102c

Please sign in to comment.