README
start-of-week
Take a locale and return its start of the week (0 = Sunday, 1 = Monday)
Usage
import getSW from 'start-of-week'
console.log(getSW()) // 0 (Sunday) if user is in North American, otherwise 1 (Monday)
console.log(getSW('')) // 1
console.log(getSW('en_AU')) // 1
console.log(getSW('en_US')) // 0
console.log(getSW('en_CA')) // 0
If you want something comprehensive, use gamtiq/weekstart instead.
Install
- Install:
npm install --save start-of-week
- Import:
import pkg from ('start-of-week')
- Require:
const pkg = require('start-of-week').default
<script type="module">
import pkg from '//cdn.skypack.dev/start-of-week@^3.8.0'
</script>
<script type="module">
import pkg from '//unpkg.com/start-of-week@^3.8.0'
</script>
<script type="module">
import pkg from '//dev.jspm.io/start-of-week@3.8.0'
</script>
Editions
This package is published with the following editions:
start-of-week/source/node.ts
is TypeScript source code with Import for modulesstart-of-week/edition-browsers/browser.js
is TypeScript compiled against ES2020 for web browsers with Import for modulesstart-of-week
aliasesstart-of-week/edition-es2019/node.js
start-of-week/edition-es2019/node.js
is TypeScript compiled against ES2019 for Node.js 10 || 12 || 14 || 16 with Require for modulesstart-of-week/edition-es2019-esm/node.js
is TypeScript compiled against ES2019 for Node.js 12 || 14 || 16 with Import for modules
History
Discover the release history by heading on over to the HISTORY.md
file.
Contribute
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Backers
Maintainers
These amazing people are maintaining this project:
Sponsors
No sponsors yet! Will you be the first?
Contributors
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
License
Unless stated otherwise all works are:
- Copyright © 2019+ Benjamin Lupton
and licensed under: