start-of-week

Take a locale and return its start of the week (0 = Sunday, 1 = Monday)

Usage no npm install needed!

<script type="module">
  import startOfWeek from 'https://cdn.skypack.dev/start-of-week';
</script>

README

start-of-week

Status of the GitHub Workflow: bevry NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Take a locale and return its start of the week (0 = Sunday, 1 = Monday)

Usage

Complete API Documentation.

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

npm

  • Install: npm install --save start-of-week
  • Import: import pkg from ('start-of-week')
  • Require: const pkg = require('start-of-week').default

Skypack

<script type="module">
    import pkg from '//cdn.skypack.dev/start-of-week@^3.8.0'
</script>

unpkg

<script type="module">
    import pkg from '//unpkg.com/start-of-week@^3.8.0'
</script>

jspm

<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 modules
  • start-of-week/edition-browsers/browser.js is TypeScript compiled against ES2020 for web browsers with Import for modules
  • start-of-week aliases start-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 modules
  • start-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?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

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:

and licensed under: