spacetime-week-start 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "spacetime-week-start",
3
3
  "description": "calculate start-of-week",
4
- "version": "0.2.0",
4
+ "version": "0.4.0",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "builds/spacetime-week-start.min.js",
7
+ "module": "builds/spacetime-week-start.mjs",
7
8
  "type": "module",
8
9
  "sideEffects": false,
9
10
  "exports": {
@@ -20,7 +21,7 @@
20
21
  "url": "git+https://github.com/spencermountain/spacetime.git"
21
22
  },
22
23
  "scripts": {
23
- "watch": "amble scratch.js",
24
+ "watch": "node --watch ./scratch.js",
24
25
  "test": "TESTENV=dev tape ./test/**/*.test.js | tap-dancer",
25
26
  "build": "rollup -c --silent"
26
27
  },
@@ -32,14 +33,13 @@
32
33
  "printWidth": 100
33
34
  },
34
35
  "devDependencies": {
35
- "amble": "1.3.0",
36
- "shelljs": "0.8.5",
36
+ "@rollup/plugin-terser": "^1.0.0",
37
+ "rollup": "4.62.2",
37
38
  "tap-dancer": "0.3.4",
38
- "tape": "5.5.3",
39
- "terser": "5.12.1"
39
+ "tape": "5.5.3"
40
40
  },
41
41
  "peerDependencies": {
42
- "spacetime": "^5.8.2"
42
+ "spacetime": ">=5.8.2"
43
43
  },
44
- "licence": "MIT"
45
- }
44
+ "license": "MIT"
45
+ }
package/rollup.config.js CHANGED
@@ -1,29 +1,26 @@
1
- import commonjs from 'rollup-plugin-commonjs'
2
- import json from 'rollup-plugin-json'
3
- import { terser } from 'rollup-plugin-terser'
4
- import resolve from 'rollup-plugin-node-resolve'
5
- import sizeCheck from 'rollup-plugin-filesize-check'
6
- import { version } from './package.json'
1
+ import fs from 'fs'
2
+ import terser from '@rollup/plugin-terser'
3
+ const pkg = JSON.parse(fs.readFileSync('./package.json').toString())
7
4
 
8
5
  console.log('\n 📦 - running rollup..\n')
9
6
 
10
- let name = 'spacetime-week-start'
11
- const banner = `/* spencermountain/${name} ` + version + ' Apache 2.0 */'
7
+ const name = 'spacetime-week-start'
8
+ const banner = `/* spencermountain/${name} ${pkg.version} MIT */`
12
9
 
13
10
  export default [
14
11
  {
15
12
  input: 'src/index.js',
16
13
  output: [{ banner: banner, file: `builds/${name}.mjs`, format: 'esm' }],
17
- plugins: [resolve(), json(), commonjs(), sizeCheck({ expect: 147, warn: 10 })]
14
+ plugins: [terser()]
18
15
  },
19
16
  {
20
17
  input: 'src/index.js',
21
18
  output: [{ banner: banner, file: `builds/${name}.cjs`, format: 'umd', sourcemap: false, name: 'weekStart' }],
22
- plugins: [resolve(), json(), commonjs(), sizeCheck({ expect: 159, warn: 10 })]
19
+ plugins: [terser()]
23
20
  },
24
21
  {
25
22
  input: 'src/index.js',
26
23
  output: [{ banner: banner, file: `builds/${name}.min.js`, format: 'umd', name: 'weekStart' }],
27
- plugins: [resolve(), json(), commonjs(), terser(), sizeCheck({ expect: 79, warn: 10 })]
24
+ plugins: [terser()]
28
25
  }
29
26
  ]
package/scratch.js CHANGED
@@ -1,6 +1,7 @@
1
- import spacetime from 'spacetime'
2
- import spacetimeWeek from './src/index.js'
1
+ import spacetime from '../../src/index.js'
2
+ import weekStartPlugin from './src/index.js'
3
3
 
4
- spacetime.extend(spacetimeWeek)
5
- let d = spacetime.now('Europe/Berlin')
6
- console.log(d.weekStart('iran'))
4
+ spacetime.extend(weekStartPlugin)
5
+ const d = spacetime.now('Europe/Berlin')
6
+ console.log(d.weekStart()) // { day: 'monday', country: 'germany' }
7
+ console.log(d.weekStart('iran')) // { day: 'saturday', country: 'iran' }
@@ -1,4 +1,4 @@
1
- let loc = {
1
+ const loc = {
2
2
  c009: 'antarctica',
3
3
  c011: 'arctic',
4
4
  c081: 'gmt',
@@ -7,7 +7,7 @@ let loc = {
7
7
  c245: 'zulu'
8
8
  }
9
9
 
10
- let firstDay = {
10
+ const firstDay = {
11
11
  monday: {
12
12
  c002: 'aland islands',
13
13
  c003: 'albania',
@@ -254,7 +254,7 @@ let firstDay = {
254
254
 
255
255
  export default {
256
256
  countries: () => {
257
- let arr = []
257
+ const arr = []
258
258
  Object.keys(firstDay).forEach(day => {
259
259
  Object.keys(firstDay[day]).forEach(country => {
260
260
  arr.push(firstDay[day][country])
package/src/index.js CHANGED
@@ -2,7 +2,6 @@ import { getWeekStart } from './input/weekStart.js'
2
2
 
3
3
  export default {
4
4
  weekStart: function (input) {
5
- input = input || this.timezone().name
6
- return getWeekStart(input)
5
+ return getWeekStart(input, this.tz)
7
6
  }
8
7
  }
@@ -1,16 +1,12 @@
1
1
  import c from '../data/countries.js'
2
- const firstDay = c.firstDay();
3
- const loc = c.locations();
4
-
5
2
  import iana from '../../zonefile/iana.js'
6
- import spacetime from 'spacetime'
7
- // const fs = require('fs');
8
-
3
+ const firstDay = c.firstDay()
4
+ const loc = c.locations()
9
5
 
10
6
  function getCountry(country) {
11
- for (let day in firstDay) {
7
+ for (const day in firstDay) {
12
8
  if (firstDay.hasOwnProperty(day)) {
13
- for (let key in firstDay[day]) {
9
+ for (const key in firstDay[day]) {
14
10
  if (firstDay[day].hasOwnProperty(key)) {
15
11
  if ((key === country) || (firstDay[day][key].indexOf(country) !== -1)) {
16
12
  return { day: day, country: firstDay[day][key] }
@@ -19,7 +15,7 @@ function getCountry(country) {
19
15
  }
20
16
  }
21
17
  }
22
- for (let item in loc) {
18
+ for (const item in loc) {
23
19
  if (loc.hasOwnProperty(item) && loc[item].indexOf(country) !== -1) {
24
20
  return { day: 'monday', location: country }
25
21
  }
@@ -27,95 +23,44 @@ function getCountry(country) {
27
23
  return {}
28
24
  }
29
25
 
26
+ // find a week-start for an iana timezone name, like 'europe/berlin'
30
27
  function getCurrent(tz) {
31
- if (!tz) {
32
- return { message: `there are problems determine time zone` }
28
+ if (!tz || typeof tz !== 'string') {
29
+ return null
33
30
  }
34
- // searches if current tz matches with iana
35
- // gets country key
36
- for (let key in iana) {
37
- if (key === tz) {
38
- if (!iana[key].ctry && !iana[key].loc) {
39
- let country = getCountry(key.substr(0, key.indexOf('/')))
40
- if (country) { return country }
41
- country = getCountry((key.substr(key.indexOf('/') + 1)).replace('_', ' '))
42
- if (country) { return country }
43
- }
44
- else if (iana[key].loc) {
45
- return getCountry(iana[key].loc)
46
- }
47
- else if (iana[key].ctry) {
48
- return getCountry(iana[key].ctry)
49
- }
50
- }
31
+ tz = tz.toLowerCase()
32
+ const zone = iana[tz]
33
+ if (!zone) {
34
+ return null
51
35
  }
52
- return null
53
- }
54
-
55
- function setWeekStart(value, newDay) {
56
-
57
- const a = {
58
- country: '',
59
- origin: '',
60
- assigned: '',
61
- key: '',
62
- isDay: false,
63
- isCountry: false
36
+ if (zone.loc) {
37
+ return getCountry(zone.loc)
64
38
  }
65
-
66
- if (!value || !newDay) { return { message: 'missing argument' } }
67
-
68
- // check if values are valid
69
- for (let day in firstDay) {
70
- if (firstDay.hasOwnProperty(day)) {
71
- if (day === newDay.toLowerCase()) { a.isDay = true }
72
- for (let key in firstDay[day]) {
73
- if (firstDay[day][key].indexOf(value.toLowerCase()) !== -1) {
74
- a.origin = day;
75
- a.assigned = newDay;
76
- a.country = firstDay[day][key];
77
- a.key = key;
78
- a.isCountry = true
79
- }
80
- }
81
- }
39
+ if (zone.ctry) {
40
+ return getCountry(zone.ctry)
82
41
  }
83
-
84
- if (!a.isDay || !a.isCountry) {
85
- return { message: 'incorrect day or country name' }
42
+ // otherwise, guess from the timezone name itself
43
+ let found = getCountry(tz.substr(0, tz.indexOf('/')))
44
+ if (found.day) {
45
+ return found
86
46
  }
87
-
88
- // when both entries are valid save new JSON
89
- delete firstDay[a.origin][a.key];
90
- firstDay[newDay][a.key] = a.country;
91
- // const data = JSON.stringify(firstDay);
92
- // fs.writeFile('../data/countries.json', data);
93
-
94
- return {
95
- country: a.country,
96
- origin: a.origin,
97
- assigned: a.assigned
98
- };
47
+ found = getCountry(tz.substr(tz.indexOf('/') + 1).replace('_', ' '))
48
+ if (found.day) {
49
+ return found
50
+ }
51
+ return null
99
52
  }
100
53
 
101
- function getWeekStart(country = '') {
102
- // checks function argument and sets default value
103
- let tz
104
- if (!country || typeof country !== 'string') {
105
- country = null
106
- tz = spacetime.now().tz
107
- }
108
- if (!country) {
109
- return getCurrent(tz);
110
- } else if (country) {
111
- let first = getCountry((country.toLowerCase()).trim())
112
- if (first) { return first }
113
- else { return getWeekStart() }
54
+ function getWeekStart(country, tz) {
55
+ // try a country-name lookup first
56
+ if (country && typeof country === 'string') {
57
+ const found = getCountry(country.toLowerCase().trim())
58
+ if (found.day) {
59
+ return found
60
+ }
114
61
  }
115
- return null
62
+ // otherwise, use the given timezone
63
+ return getCurrent(tz)
116
64
  }
117
65
 
118
- export {
119
- getWeekStart,
120
- setWeekStart
121
- }
66
+ export { getWeekStart }
@@ -1,56 +1,58 @@
1
1
  import test from 'tape'
2
- import { getWeekStart as weekStart } from '../src/input/weekStart.js'
2
+ import spacetime from '../../../src/index.js'
3
+ import weekStartPlugin from '../src/index.js'
3
4
 
4
- test('week by country returns values, when no or falsy argument is supplied', t => {
5
- t.notEqual(weekStart(), null)
6
- t.notEqual(weekStart(), undefined)
7
- t.notEqual(weekStart(12), null)
8
- t.notEqual(weekStart(12), undefined)
5
+ spacetime.extend(weekStartPlugin)
9
6
 
10
- t.notEqual(weekStart(null), null)
11
- t.notEqual(weekStart(null), undefined)
12
- t.notEqual(weekStart(''), null)
13
- t.notEqual(weekStart(''), undefined)
7
+ test('uses the timezone of the spacetime object', t => {
8
+ t.deepEqual(spacetime.now('Europe/Berlin').weekStart(), { day: 'monday', country: 'germany' })
9
+ t.deepEqual(spacetime.now('America/Toronto').weekStart(), { day: 'sunday', country: 'canada' })
10
+ t.deepEqual(spacetime.now('Asia/Tehran').weekStart(), { day: 'saturday', country: 'iran' })
11
+ t.end()
12
+ })
14
13
 
15
- t.notEqual(weekStart(undefined), null)
16
- t.notEqual(weekStart(undefined), undefined)
17
- t.notEqual(weekStart('abc'), null)
18
- t.notEqual(weekStart('abc'), undefined)
14
+ test('general timezones return a location', t => {
15
+ t.deepEqual(spacetime.now('Etc/Zulu').weekStart(), { day: 'monday', location: 'zulu' })
19
16
  t.end()
20
17
  })
21
18
 
22
- test('JSON values are string and not empty', t => {
23
- t.equal(typeof weekStart().day, 'string')
24
- t.notEqual(weekStart().day, '')
25
- t.equal(typeof weekStart().country, 'string')
26
- t.notEqual(weekStart().country, '')
19
+ test('falsy or unknown input falls back to the timezone', t => {
20
+ const s = spacetime.now('America/Toronto')
21
+ t.deepEqual(s.weekStart(null), { day: 'sunday', country: 'canada' })
22
+ t.deepEqual(s.weekStart(''), { day: 'sunday', country: 'canada' })
23
+ t.deepEqual(s.weekStart(12), { day: 'sunday', country: 'canada' })
24
+ t.deepEqual(s.weekStart('xyzxyz'), { day: 'sunday', country: 'canada' })
27
25
  t.end()
28
26
  })
29
27
 
30
- test('when supplied full coutry name returns day and country', t => {
31
- t.equal(weekStart('canada').day, 'sunday')
32
- t.equal(weekStart('canada').country, 'canada')
28
+ test('a country name wins over the timezone', t => {
29
+ const s = spacetime.now('Europe/Berlin')
30
+ t.equal(s.weekStart('canada').day, 'sunday')
31
+ t.equal(s.weekStart('canada').country, 'canada')
32
+ t.equal(s.weekStart('iran').day, 'saturday')
33
33
  t.end()
34
34
  })
35
35
 
36
- test('when supplied partial coutry name returns day and country', t => {
37
- t.equal(weekStart('united arab emirates').day, 'sunday')
38
- t.equal(weekStart('emirates').country, 'united arab emirates')
36
+ test('partial country names match', t => {
37
+ const s = spacetime.now('America/Toronto')
38
+ t.equal(s.weekStart('united arab emirates').day, 'sunday')
39
+ t.equal(s.weekStart('emirates').country, 'united arab emirates')
39
40
  t.end()
40
41
  })
41
42
 
42
43
  test('country name can be in lower case, upper case or camel case', t => {
43
- t.equal(weekStart('cana').day, 'sunday')
44
- t.equal(weekStart('nada').country, 'grenada')
45
- t.notEqual(weekStart('nada').country, 'canada')
44
+ const s = spacetime.now('America/Toronto')
45
+ t.equal(s.weekStart('cana').day, 'sunday')
46
+ t.equal(s.weekStart('nada').country, 'grenada')
47
+ t.notEqual(s.weekStart('nada').country, 'canada')
46
48
  // finds first occourance of string 'nada' in JSON
47
- t.equal(weekStart('CANADA').day, 'sunday')
48
- t.equal(weekStart('Canada').country, 'canada')
49
+ t.equal(s.weekStart('CANADA').day, 'sunday')
50
+ t.equal(s.weekStart('Canada').country, 'canada')
49
51
  // it's located in array under key "monday" for
50
- // grenada and after that appears located in
52
+ // grenada and after that appears located in
51
53
  // canada under key "sunday"
52
- t.equal(weekStart('CaNa').day, 'sunday')
53
- t.equal(weekStart('nAdA').country, 'grenada')
54
- t.notEqual(weekStart('nAdA').country, 'canada')
54
+ t.equal(s.weekStart('CaNa').day, 'sunday')
55
+ t.equal(s.weekStart('nAdA').country, 'grenada')
56
+ t.notEqual(s.weekStart('nAdA').country, 'canada')
55
57
  t.end()
56
58
  })
package/_version.js DELETED
@@ -1 +0,0 @@
1
- export default '0.0.1'
package/types/types.d.ts DELETED
@@ -1,202 +0,0 @@
1
- import { TimeUnit, Format } from './constraints'
2
-
3
- export interface SpacetimeMain {
4
- /** move to a new timezone, but at this same moment. Accepts an IANA code or abbreviation */
5
- goto: (target: string) => Spacetime
6
-
7
- /** @returns a copy of this object, with no references to the original */
8
- clone: () => Spacetime
9
-
10
- /** @returns a bunch of meta-data about your current timezone */
11
- timezone: () => TimezoneMeta
12
-
13
- /** output nicely-formatted strings */
14
- format: (format: Format) => string | object
15
-
16
- /** output formatted string using unix formatting code (yyyy.MM.dd h:mm a) */
17
- unixFmt: (format: string) => string
18
-
19
- /** move to the first millisecond of the day, week, month, year, etc. */
20
- startOf: (unit: TimeUnit) => Spacetime
21
-
22
- /** move to the last millisecond of the day, week, month, year, etc. */
23
- endOf: (unit: TimeUnit) => Spacetime
24
-
25
- /** increment the time by a number and unit - like an hour, minute, day, or year */
26
- add: (value: number, unit: TimeUnit) => Spacetime
27
-
28
- /** decrease the time by a number and unit - like an hour, minute, day, or year */
29
- subtract: (value: number, unit: TimeUnit) => Spacetime
30
-
31
- /** go to the beginning of the next unit */
32
- next: (unit: TimeUnit) => Spacetime
33
-
34
- /** go to the beginning of the previous unit */
35
- last: (unit: TimeUnit) => Spacetime
36
-
37
- /** pass-in a spacetime object or date input and see if it takes-place after your spacetime date/time */
38
- isAfter: (other: Spacetime | Date) => Spacetime
39
-
40
- /** pass-in a spacetime object or date input and see if it takes-place before your spacetime date/time */
41
- isBefore: (other: Spacetime | Date) => Spacetime
42
-
43
- /** is this date on the exact same millisecond as another */
44
- isEqual: (other: Spacetime | Date) => boolean
45
-
46
- /** detect if two date/times are the same day, week, or year, etc */
47
- isSame: (other: Spacetime | Date, unit: TimeUnit) => boolean
48
-
49
- /** given a date and a unit, count how many of them you'd need to make the dates equal */
50
- diff(value: Spacetime | ParsableDate, unit: TimeUnit): number
51
-
52
- /** given a date, count how many of various units to make the dates equal */
53
- diff(value: Spacetime | ParsableDate): Diff
54
- }
55
-
56
- /** The return types are not actually both number and Spacetime, but this aids in casting to the proper type */
57
- export interface SpacetimeGetterSetters {
58
- /** set or return the current number of milliseconds (0-999) */
59
- millisecond: (value?: number) => number & Spacetime
60
-
61
- /** set or return the current number of seconds (0-59) */
62
- second: (value?: number) => number & Spacetime
63
-
64
- /** set or return the current number of minutes (0-59) */
65
- minute: (value?: number) => number & Spacetime
66
-
67
- /** set or return the current hour, in 24 time (0-23). also accepts/parses '3pm' */
68
- hour: (value?: number | string) => number & Spacetime
69
-
70
- /** set or return the day-number of the month (1- max31) */
71
- date: (value?: number) => number & Spacetime
72
-
73
- /** set or return the zero-based month-number (0-11). Also accepts 'June', or 'oct'. */
74
- month: (value?: string) => number & Spacetime
75
-
76
- /** set or return the 4-digit year as an integer */
77
- year: (value?: number) => number & Spacetime
78
-
79
- /** set or return a formatted, 12-hour time, like '11:30pm' */
80
- time: (value?: string) => number & Spacetime
81
-
82
- /** set or return the week-number of the year (1-52) */
83
- week: (value?: number) => number & Spacetime
84
-
85
- /** set or return the fiscal-quarter (1-4) */
86
- quarter: (value?: number) => number & Spacetime
87
-
88
- /** set or return the name of the season, spring/summer/fall/autumn/winter */
89
- season: (value?: string) => string & Spacetime
90
-
91
- /** set or return the hour + minute in decimal form, so '3:30am' is 3.5 */
92
- hourFloat: (value?: number) => number & Spacetime
93
-
94
- /** set or return the day of the week as an integer, starting on sunday (day-0). Also accepts names like 'wednesday', or 'thurs' */
95
- day: (value?: number | string) => number & Spacetime
96
-
97
- /** set or return whether the time is am or pm */
98
- ampm: (value?: string) => string & Spacetime
99
-
100
- /** set or return the general time-of-day, like 'afternoon' */
101
- dayTime: (value?: string) => string & Spacetime
102
-
103
- /** set or return the current month as a string, like 'april' */
104
- monthName: (value?: string) => string & Spacetime
105
- }
106
-
107
- export interface SpacetimeUtils {
108
- /** change to a new date */
109
- set(date: ParsableDate): Spacetime
110
-
111
- /** does this time exist on the gregorian/javascript calendar? */
112
- isValid: () => boolean
113
-
114
- /** pretty-print the date to the console, for nicer debugging */
115
- log: () => string
116
-
117
- /** Between 0-1, how far the moment lands between the start and end of the day/week/month/year. */
118
- progress: () => Progress
119
-
120
- /** is the current year a leap year? */
121
- leapYear: () => boolean
122
-
123
- /** is daylight-savings-time activated right now, for this timezone? */
124
- inDST: () => boolean
125
-
126
- /** does this timezone ever use daylight-savings */
127
- hasDST: () => boolean
128
-
129
- /** the current, DST-aware time-difference from UTC, in hours */
130
- offset: () => number
131
-
132
- /** checks if the current time is between 10pm and 8am */
133
- isAsleep: () => boolean
134
- }
135
-
136
- export interface Spacetime extends SpacetimeMain, SpacetimeGetterSetters, SpacetimeUtils {
137
- /** @returns epoch in milliseconds */
138
- epoch: number
139
-
140
- /** @returns whether warnings are enabled */
141
- silent: boolean
142
-
143
- /** @returns the timezone tz database name, eg, 'america/denver' */
144
- tz: string
145
-
146
- /** @returns the tz database nameset */
147
- timezones: TimezoneSet
148
- }
149
-
150
- export interface TimezoneMeta {
151
- change?: { start: string; back: string }
152
- current: { offset: number; isDST: boolean }
153
- default_offset: number
154
- display: string
155
- hasDst: boolean
156
- hemisphere: string
157
- name: string
158
- }
159
-
160
- export interface Progress {
161
- /** Progress of value from 0-1 */
162
- day: number
163
- /** Progress of value from 0-1 */
164
- hour: number
165
- /** Progress of value from 0-1 */
166
- minute: number
167
- /** Progress of value from 0-1 */
168
- month: number
169
- /** Progress of value from 0-1 */
170
- quarter: number
171
- /** Progress of value from 0-1 */
172
- quarterHour: number
173
- /** Progress of value from 0-1 */
174
- season: number
175
- /** Progress of value from 0-1 */
176
- week: number
177
- /** Progress of value from 0-1 */
178
- year: number
179
- }
180
-
181
- export interface Diff {
182
- days: number
183
- hours: number
184
- milliseconds: number
185
- minutes: number
186
- months: number
187
- seconds: number
188
- weeks: number
189
- years: number
190
- }
191
-
192
- /** set where the key is tz database name in lowercase, eg, 'america/denver' */
193
- export interface TimezoneSet {
194
- [key: string]: {
195
- offset: number
196
- hem: string
197
- dst?: string
198
- ctry?: string
199
- }
200
- }
201
-
202
- export type ParsableDate = Date | number | Array<number> | string
package/weekStart-demo.js DELETED
@@ -1,47 +0,0 @@
1
- import weekStart from './src/input/weekStart.js';
2
-
3
- console.log('#1: ', weekStart());
4
- console.log('#2: ', weekStart(12));
5
- console.log('#3: ', weekStart(null));
6
- console.log('#4: ', weekStart(''));
7
- console.log('#5: ', weekStart(undefined));
8
- console.log('#6: ', weekStart('abc'));
9
- // all returns results for current tz, f.e.
10
- // { day: 'sunday', country: 'canada' }
11
-
12
- console.log('#7: ', weekStart('slovakia'));
13
- // tz: europe/bratislava
14
- // { day: 'monday', country: 'slovakia' }
15
-
16
- console.log('#8: ', weekStart('iran'));
17
- //tz: asia/tehran
18
- // { day: 'saturday', country: 'iran' }
19
-
20
- console.log('#9: ', weekStart('canAda'));
21
- //tz: f.e. america/montreal
22
- // { day: 'sunday', country: 'canada' }
23
-
24
- console.log('#10: ', weekStart('lize'));
25
- // tz: america/belize
26
- // { day: 'monday', country: 'belize' }
27
-
28
- console.log('#11: ', weekStart('el salvador'));
29
- // tz: america/el_salvador
30
- // { day: 'monday', country: 'el salvador' }
31
-
32
- console.log('#12: ', weekStart('zulu'));
33
- // tz: etc/zulu
34
- // { day: 'monday', location: 'zulu' }
35
-
36
- console.log('#13: ', weekStart('gmt'));
37
- // tz: f.e. etc/gmt
38
- // { day: 'monday', location: 'gmt' }
39
-
40
- console.log('#14: ', weekStart('antarctica'));
41
- // tz: f.e. antarctica/south_pole
42
- // { day: 'monday', location: 'antarctica' }
43
-
44
- console.log('#15: ', weekStart('arctic'));
45
- // tz: f.e. arctic/longyearbyen
46
- // { day: 'monday', location: 'arctic' }
47
-