{"_id":"weekstart","_rev":"2822135","name":"weekstart","description":"Library to get first day of week.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"npm:gamtiq","email":""}],"time":{"modified":"2022-09-06T14:22:14.000Z","created":"2017-09-07T20:42:43.294Z","1.1.0":"2021-03-15T21:31:27.480Z","1.0.1":"2019-10-19T18:38:36.978Z","1.0.0":"2018-01-20T15:28:53.629Z","0.1.0":"2017-09-07T20:42:43.294Z"},"users":{},"author":{"name":"Denis Sikuler"},"repository":{"type":"git","url":"git://github.com/gamtiq/weekstart.git"},"versions":{"1.1.0":{"name":"weekstart","version":"1.1.0","description":"Library to get first day of week.","homepage":"https://github.com/gamtiq/weekstart","main":"dist/commonjs/main.js","module":"dist/es-module/main.js","umd:main":"dist/main.js","keywords":["week","start","first","day","locale","country","region"],"devDependencies":{"@babel/preset-env":"^7.13.10","eslint":"^7.22.0","eslint-config-guard":"^2.0.1","ink-docstrap":"1.3.2","jest":"^26.6.3","jsdoc":"^3.6.6","jsdoc-file":"^1.0.1","microbundle":"0.4.4","version-bump-prompt":"^6.1.0"},"scripts":{"lint":"eslint --cache --max-warnings 0 \"**/*.js\"","lint-error":"eslint --cache \"**/*.js\"","lint-all":"eslint --max-warnings 0 \"**/*.js\"","lint-all-error":"eslint \"**/*.js\"","test":"jest","check":"npm run lint && npm test","check-all":"npm run lint-all && npm test","doc":"jsdoc -c jsdoc-conf.js","build-commonjs":"microbundle build \"src/!(*.test).js\" --output dist/commonjs --format cjs --strict --no-compress","build-esm":"microbundle build \"src/!(*.test).js\" --output dist/es-module --format es --no-compress","build-umd":"microbundle build src/main.js src/full.js --output dist --format umd --strict --no-compress","build-umd-min":"microbundle build src/main.js src/full.js --output dist/min --format umd --strict","build":"npm run build-umd && npm run build-commonjs && npm run build-esm && npm run build-umd-min","all":"npm run check-all && npm run doc && npm run build","release":"bump patch --commit --tag --all --push package.json package-lock.json bower.json component.json","release-minor":"bump minor --commit --tag --all --push package.json package-lock.json bower.json component.json","release-major":"bump major --commit --tag --all --push package.json package-lock.json bower.json component.json"},"author":{"name":"Denis Sikuler"},"repository":{"type":"git","url":"git://github.com/gamtiq/weekstart.git"},"bugs":{"url":"https://github.com/gamtiq/weekstart/issues"},"license":"MIT","types":"./index.d.ts","gitHead":"05636a53241e683e6aec508952e2149d5799fbb9","_id":"weekstart@1.1.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"shasum":"af642eb10dc24b1af9d4dcc0415056edc087b897","size":40874,"noattachment":false,"key":"/weekstart/-/weekstart-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/weekstart/download/weekstart-1.1.0.tgz"},"_npmUser":{"name":"gamtiq","email":"mforeg@yandex.ru"},"directories":{},"maintainers":[{"name":"npm:gamtiq","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/weekstart_1.1.0_1615843887289_0.12237192637014416"},"_hasShrinkwrap":false,"publish_time":1615843887480,"_cnpm_publish_time":1615843887480,"_cnpmcore_publish_time":"2021-12-17T01:15:25.459Z"},"1.0.1":{"name":"weekstart","version":"1.0.1","description":"Library to get first day of week.","homepage":"https://github.com/gamtiq/weekstart","main":"dist/commonjs/main.js","module":"dist/es-module/main.js","umd:main":"dist/main.js","keywords":["week","start","first","day","locale","country","region"],"devDependencies":{"@babel/preset-env":"7.6.3","eslint":"6.5.1","eslint-config-guard":"1.0.3","ink-docstrap":"1.3.2","jest":"24.9.0","jsdoc":"3.6.3","microbundle":"0.4.4","version-bump-prompt":"5.0.5"},"scripts":{"lint":"eslint --cache --max-warnings 0 \"**/*.js\"","lint-error":"eslint --cache \"**/*.js\"","lint-all":"eslint --max-warnings 0 \"**/*.js\"","lint-all-error":"eslint \"**/*.js\"","test":"jest","check":"npm run lint && npm test","check-all":"npm run lint-all && npm test","doc":"jsdoc -c jsdoc-conf.json","build-commonjs":"microbundle build \"src/!(*.test).js\" --output dist/commonjs --format cjs --strict --no-compress","build-esm":"microbundle build \"src/!(*.test).js\" --output dist/es-module --format es --no-compress","build-umd":"microbundle build src/main.js src/full.js --output dist --format umd --strict --no-compress","build-umd-min":"microbundle build src/main.js src/full.js --output dist/min --format umd --strict","build":"npm run build-umd && npm run build-commonjs && npm run build-esm && npm run build-umd-min","all":"npm run check-all && npm run doc && npm run build","release":"bump patch --commit --tag --all --push package.json package-lock.json bower.json component.json","release-minor":"bump minor --commit --tag --all --push package.json package-lock.json bower.json component.json","release-major":"bump major --commit --tag --all --push package.json package-lock.json bower.json component.json"},"author":{"name":"Denis Sikuler"},"repository":{"type":"git","url":"git://github.com/gamtiq/weekstart.git"},"bugs":{"url":"https://github.com/gamtiq/weekstart/issues"},"license":"MIT","types":"./index.d.ts","gitHead":"ce2b79da6d7b63f2a33ad24b00c0b4e4fd5d61c9","_id":"weekstart@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"gamtiq","email":"mforeg@yandex.ru"},"maintainers":[{"name":"npm:gamtiq","email":""}],"dist":{"shasum":"950970b48e5797e06fc1a762f3d0f013312321e1","size":775780,"noattachment":false,"key":"/weekstart/-/weekstart-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/weekstart/download/weekstart-1.0.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/weekstart_1.0.1_1571510316755_0.5594481628104537"},"_hasShrinkwrap":false,"publish_time":1571510316978,"_cnpm_publish_time":1571510316978,"_cnpmcore_publish_time":"2021-12-17T01:15:27.694Z"},"1.0.0":{"name":"weekstart","version":"1.0.0","description":"Library to get first day of week.","homepage":"https://github.com/gamtiq/weekstart","main":"dist/commonjs/main.js","module":"dist/es-module/main.js","umd:main":"dist/main.js","keywords":["week","start","first","day","locale","country","region"],"devDependencies":{"babel-preset-es2015":"6.24.1","eslint":"4.5.0","eslint-config-guard":"0.3.0","ink-docstrap":"1.3.0","jest":"20.0.4","jsdoc":"3.5.4","microbundle":"0.3.1","version-bump-prompt":"3.1.2"},"scripts":{"lint":"eslint --cache --max-warnings 0 \"**/*.js\"","lint-error":"eslint --cache \"**/*.js\"","lint-all":"eslint --max-warnings 0 \"**/*.js\"","lint-all-error":"eslint \"**/*.js\"","test":"jest","check":"npm run lint && npm test","check-all":"npm run lint-all && npm test","doc":"jsdoc -c jsdoc-conf.json","build-commonjs":"microbundle build src/main.js src/full.js src/api.js src/fullLangRegionMap.js src/langRegionMap.js src/regionDayMap.js --output dist/commonjs --format cjs --strict --no-compress","build-esm":"microbundle build src/main.js src/full.js src/api.js src/fullLangRegionMap.js src/langRegionMap.js src/regionDayMap.js --output dist/es-module --format es --no-compress","build-umd":"microbundle build src/main.js src/full.js --output dist --format umd --strict --no-compress","build-umd-min":"microbundle build src/main.js src/full.js --output dist/min --format umd --strict","build":"npm run build-umd && npm run build-commonjs && npm run build-esm && npm run build-umd-min","all":"npm run check-all && npm run doc && npm run build","release":"bump --patch --commit --tag --all --push","release-minor":"bump --minor --commit --tag --all --push","release-major":"bump --major --commit --tag --all --push"},"author":{"name":"Denis Sikuler"},"repository":{"type":"git","url":"git://github.com/gamtiq/weekstart.git"},"bugs":{"url":"https://github.com/gamtiq/weekstart/issues"},"license":"MIT","gitHead":"c63430e3da4dcb7fa62b5c6af0795327a12ff0cc","_id":"weekstart@1.0.0","_shasum":"e0aee358d45ad99802254769d7b2a34c9380f539","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"gamtiq","email":"mforeg@yandex.ru"},"maintainers":[{"name":"npm:gamtiq","email":""}],"dist":{"shasum":"e0aee358d45ad99802254769d7b2a34c9380f539","size":741785,"noattachment":false,"key":"/weekstart/-/weekstart-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/weekstart/download/weekstart-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/weekstart-1.0.0.tgz_1516462131932_0.8530492905993015"},"directories":{},"publish_time":1516462133629,"_hasShrinkwrap":false,"_cnpm_publish_time":1516462133629,"_cnpmcore_publish_time":"2021-12-17T01:15:29.844Z"},"0.1.0":{"name":"weekstart","version":"0.1.0","description":"Library to get first day of week.","homepage":"https://github.com/gamtiq/weekstart","main":"dist/commonjs/weekstart.js","keywords":["week","start","first","day","locale","country","region"],"devDependencies":{"babel-cli":"6.26.0","babel-plugin-transform-es2015-modules-commonjs":"6.26.0","babel-plugin-transform-es2015-modules-umd":"6.24.1","babel-preset-es2015":"6.24.1","cross-env":"5.0.5","eslint":"4.5.0","eslint-config-guard":"0.3.0","ink-docstrap":"1.3.0","jest":"20.0.4","jsdoc":"3.5.4","uglify-js":"3.0.28","version-bump-prompt":"3.1.2"},"scripts":{"lint":"eslint --cache --max-warnings 0 \"**/*.js\"","lint-error":"eslint --cache \"**/*.js\"","lint-all":"eslint --max-warnings 0 \"**/*.js\"","lint-all-error":"eslint \"**/*.js\"","test":"jest","check":"npm run lint && npm test","check-all":"npm run lint-all && npm test","doc":"jsdoc -c jsdoc-conf.json","build-commonjs":"cross-env BABEL_ENV=commonjs babel src --ignore test.js --out-dir dist/commonjs --source-maps","build-umd":"cross-env BABEL_ENV=umd babel src --ignore test.js --out-dir dist --source-maps","minify":"uglifyjs dist/weekstart.js --output dist/weekstart.min.js --compress --mangle --source-map content=\"dist/weekstart.js.map\",url=weekstart.min.js.map","build":"npm run build-commonjs && npm run build-umd && npm run minify","all":"npm run check-all && npm run doc && npm run build","release":"bump --patch --commit --tag --all --push","release-minor":"bump --minor --commit --tag --all --push","release-major":"bump --major --commit --tag --all --push"},"author":{"name":"Denis Sikuler"},"repository":{"type":"git","url":"git://github.com/gamtiq/weekstart.git"},"bugs":{"url":"https://github.com/gamtiq/weekstart/issues"},"license":"MIT","gitHead":"a82f6490782630008c0da73c1061bbf49bd4b6cb","_id":"weekstart@0.1.0","_shasum":"a05b84c6ef218bffb7443dbe65c687a7dd0feacf","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"gamtiq","email":"mforeg@yandex.ru"},"maintainers":[{"name":"npm:gamtiq","email":""}],"dist":{"shasum":"a05b84c6ef218bffb7443dbe65c687a7dd0feacf","size":736197,"noattachment":false,"key":"/weekstart/-/weekstart-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/weekstart/download/weekstart-0.1.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/weekstart-0.1.0.tgz_1504816961559_0.7669135923497379"},"directories":{},"publish_time":1504816963294,"_hasShrinkwrap":false,"_cnpm_publish_time":1504816963294,"_cnpmcore_publish_time":"2021-12-17T01:15:31.774Z"}},"readme":"# weekstart <a name=\"start\"></a>\n\n[![NPM version](https://badge.fury.io/js/weekstart.png)](http://badge.fury.io/js/weekstart)\n\nLibrary to get first day of week.\n\n```js\ngetWeekStartByRegion('MAC');   // 0\n\ngetWeekStartByLocale('ary');   // 6\n```\n\nThe library is based on the following data from Unicode (especially from Common Locale Data Repository) and from ISO:\n* [https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json](https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json)\n* [http://www.unicode.org/cldr/charts/28/supplemental/territory_information.html](http://www.unicode.org/cldr/charts/28/supplemental/territory_information.html)\n* [http://www.unicode.org/cldr/charts/28/supplemental/territory_language_information.html](http://www.unicode.org/cldr/charts/28/supplemental/territory_language_information.html)\n* [http://www.unicode.org/cldr/charts/28/supplemental/language_territory_information.html](http://www.unicode.org/cldr/charts/28/supplemental/language_territory_information.html)\n* [http://www.unicode.org/reports/tr35/tr35.html#Unicode_Language_and_Locale_Identifiers](http://www.unicode.org/reports/tr35/tr35.html#Unicode_Language_and_Locale_Identifiers)\n* [https://www.iso.org/iso-3166-country-codes.html](https://www.iso.org/iso-3166-country-codes.html)\n\nThere are 2 variants of the library having identical [API](#api):\n* `main` - uses base mapping of language code to country code from [langRegionMap](https://github.com/gamtiq/weekstart/blob/master/src/langRegionMap.js).\n* `full` - uses full mapping of language code to country code from [fullLangRegionMap](https://github.com/gamtiq/weekstart/blob/master/src/fullLangRegionMap.js).\n\n[langRegionMap](https://github.com/gamtiq/weekstart/blob/master/src/langRegionMap.js) contains only main language codes.\nIt is data subset from [fullLangRegionMap](https://github.com/gamtiq/weekstart/blob/master/src/fullLangRegionMap.js).\n\n## Table of contents\n\n* [Installation](#install)\n* [Usage](#usage)\n* [Examples](#examples)\n* [API](#api)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Installation <a name=\"install\"></a> [&#x2191;](#start)\n\n### Node\n\n    npm install weekstart\n\n### [Bower](http://bower.io)\n\n    bower install weekstart\n\n### AMD/UMD, &lt;script&gt;\n\nUse `dist/main.js` or `dist/min/main.js` (minified version).\nUse `dist/full.js` or `dist/min/full.js` (minified version) when you need full locale data.\n\n## Usage <a name=\"usage\"></a> [&#x2191;](#start)\n\n### ECMAScript 6\n\n```js\nimport {getWeekStartByLocale, getWeekStartByRegion} from 'weekstart';\n```\n\nIf you need full data:\n\n```js\nimport {getWeekStartByLocale, getWeekStartByRegion} from 'weekstart/full';\n```\n\n### Node\n\n```js\nconst getWeekStartByLocale = require('weekstart').getWeekStartByLocale;\nconst getWeekStartByRegion = require('weekstart').getWeekStartByRegion;\n```\n\nIf you need full data:\n\n```js\nconst getWeekStartByLocale = require('weekstart/full').getWeekStartByLocale;\nconst getWeekStartByRegion = require('weekstart/full').getWeekStartByRegion;\n```\n\n### AMD/UMD\n\n```js\ndefine(['path/to/dist/main.js'], function(weekstart) {\n    const getWeekStartByLocale = weekstart.getWeekStartByLocale;\n    const getWeekStartByRegion = weekstart.getWeekStartByRegion;\n});\n```\n\nIf you need full data:\n\n```js\ndefine(['path/to/dist/full.js'], function(weekstart) {\n    const getWeekStartByLocale = weekstart.getWeekStartByLocale;\n    const getWeekStartByRegion = weekstart.getWeekStartByRegion;\n});\n```\n\n### Bower, &lt;script&gt;\n\n```html\n<!-- Use bower_components/weekstart/dist/main.js and bower_components/weekstart/dist/full.js if the library was installed by Bower -->\n<script type=\"text/javascript\" src=\"path/to/dist/main.js\"></script>\n<script type=\"text/javascript\">\n    // weekstart is available via weekstart field of window object\n    const getWeekStartByLocale = weekstart.getWeekStartByLocale;\n    const getWeekStartByRegion = weekstart.getWeekStartByRegion;\n</script>\n```\n\nIf you need full data use `path/to/dist/full.js` instead of `path/to/dist/main.js`.\n\n## Examples <a name=\"examples\"></a> [&#x2191;](#start)\n\n```js\ngetWeekStartByRegion('dj');   // 6\ngetWeekStartByRegion('No');   // 1\ngetWeekStartByRegion('CAN');   // 0\ngetWeekStartByRegion(50);   // 5\n\ngetWeekStartByLocale('Jam');   // 0\ngetWeekStartByLocale('Fa');   // 6\ngetWeekStartByLocale('vi');   // 1\ngetWeekStartByLocale('es_MX');   // 0\ngetWeekStartByLocale('az-Arab-IRN');   // 6\n```\n\nIn the following examples results are given for the function from `full.js`.\nThe same calls for the function from `main.js` will return `1`.\n\n```js\ngetWeekStartByLocale('CCP');   // 5\ngetWeekStartByLocale('UZ-arab');   // 6\n```\n\n## API <a name=\"api\"></a> [&#x2191;](#start)\n\n#### getWeekStartByLocale(locale): number\n\nReturn first day of week for locale identifier:\n0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.\n\n#### getWeekStartByRegion(regionCode): number\n\nReturn first day of week for country/region code:\n0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.\n\nSee [`docs`](https://gamtiq.github.io/weekstart/) for details.\n\n## Contributing <a name=\"contributing\"></a> [&#x2191;](#start)\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\nAdd unit tests for any new or changed functionality.\nLint and test your code.\n\n## License <a name=\"license\"></a> [&#x2191;](#start)\nLicensed under the [MIT license](https://github.com/gamtiq/weekstart/blob/master/LICENSE).\n","_attachments":{},"homepage":"https://github.com/gamtiq/weekstart","bugs":{"url":"https://github.com/gamtiq/weekstart/issues"},"license":"MIT"}