fix: 🐛 Localised names of days

This commit is contained in:
Johan Öbrink 2021-04-27 15:26:50 +02:00 committed by Viktor Sarström
parent ebb03408a1
commit fe2781994d
3 changed files with 76 additions and 56 deletions

View File

@ -11,8 +11,7 @@ import moment from 'moment'
import { StyleSheet, View } from 'react-native'
import { useMenu, useTimetable } from '@skolplattformen/api-hooks'
import { TimetableEntry, Child } from '@skolplattformen/embedded-api'
const days = ['måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag']
import { LanguageService } from '../services/languageService'
interface WeekProps {
child: Child
@ -91,6 +90,8 @@ export const Day = ({ weekDay, lunch, lessons }: DayProps) =>
) : null
export const Week = ({ child }: WeekProps) => {
moment.locale(LanguageService.getLanguageCode())
const days = moment.weekdaysShort().slice(1, 6)
let date = moment() // skip today after school, pick tomorrow
//if (date.isoWeekday() > 5) date = date.add(3, 'days').startOf('week') // skip weekends, pick monday next week instead
const [selectedIndex, setSelectedIndex] = React.useState(
@ -98,7 +99,6 @@ export const Week = ({ child }: WeekProps) => {
)
const [year, week] = [moment().isoWeekYear(), moment().isoWeek()]
const { data: lessons } = useTimetable(child, week, year)
console.log(lessons)
const { data: menu } = useMenu(child)
return (

View File

@ -1507,6 +1507,7 @@
integrity sha512-QZDRCgs2nXyAOpN4IwnfGNsa5ejlfyej+L1DBq6hA/VEpijdFydKmxmJVdty7jRd9cH4aklbE5rCfXAuVaWIGg==
>>>>>>> feat: 🎸 Polish support in curriculum
<<<<<<< HEAD
<<<<<<< HEAD
"@skolplattformen/embedded-api@4.4.1":
version "4.4.1"
@ -1518,6 +1519,12 @@
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-5.1.1.tgz#4a38cc3e4638355cbe5d0072a9b7e463d041014b"
integrity sha512-XeMuT5kWXIbk4fcl/ZYKQfSxUe9vBfuzLpll8qWrsf1lcwA3S5HgMoGIDmm1Govq75EeavHFZyJL5f/amBNoVg==
>>>>>>> fix: 🐛 Förbättrad markdown-parsning
=======
"@skolplattformen/embedded-api@5.1.2":
version "5.1.2"
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-5.1.2.tgz#c342d0a8b29d7c8d5a60d8b86e33e03eccc728c3"
integrity sha512-2xQZS1HRFKmLdvjeRQvkXG+yn3NSxWOiAvHtr8Kck/EsZ3pdMbuyp5X2ZNrhC15TlTSl+1SPmnonj+7KPAre/Q==
>>>>>>> fix: 🐛 Localised names of days
dependencies:
"@types/he" "^1.1.1"
camelcase-keys "^6.2.2"

119
yarn.lock
View File

@ -763,9 +763,9 @@
infer-owner "^1.0.4"
"@npmcli/run-script@^1.8.2":
version "1.8.4"
resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-1.8.4.tgz#03ced92503a6fe948cbc0975ce39210bc5e824d6"
integrity sha512-Yd9HXTtF1JGDXZw0+SOn+mWLYS0e7bHBHVC/2C8yqs4wUrs/k8rwBSinD7rfk+3WG/MFGRZKxjyoD34Pch2E/A==
version "1.8.5"
resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-1.8.5.tgz#f250a0c5e1a08a792d775a315d0ff42fc3a51e1d"
integrity sha512-NQspusBCpTjNwNRFMtz2C5MxoxyzlbuJ4YEhxAKrIonTiirKDtatsZictx9RgamQIx6+QuHMNmPl0wQdoESs9A==
dependencies:
"@npmcli/node-gyp" "^1.0.2"
"@npmcli/promise-spawn" "^1.3.2"
@ -811,10 +811,10 @@
"@octokit/types" "^6.0.3"
universal-user-agent "^6.0.0"
"@octokit/openapi-types@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-6.0.0.tgz#7da8d7d5a72d3282c1a3ff9f951c8133a707480d"
integrity sha512-CnDdK7ivHkBtJYzWzZm7gEkanA7gKH6a09Eguz7flHw//GacPJLmkHA3f3N++MJmlxD1Fl+mB7B32EEpSCwztQ==
"@octokit/openapi-types@^6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-6.2.0.tgz#6ea796b20c7111b9e422a4d607f796c1179622cd"
integrity sha512-V2vFYuawjpP5KUb8CPYsq20bXT4qnE8sH1QKpYqUlcNOntBiRr/VzGVvY0s+YXGgrVbFUVO4EI0VnHYSVBWfBg==
"@octokit/plugin-enterprise-rest@^6.0.1":
version "6.0.1"
@ -833,12 +833,12 @@
resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.3.tgz#70a62be213e1edc04bb8897ee48c311482f9700d"
integrity sha512-4RFU4li238jMJAzLgAwkBAw+4Loile5haQMQr+uhFq27BmyJXcXSKvoQKqh0agsZEiUlW6iSv3FAgvmGkur7OQ==
"@octokit/plugin-rest-endpoint-methods@5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.0.tgz#cf2cdeb24ea829c31688216a5b165010b61f9a98"
integrity sha512-Jc7CLNUueIshXT+HWt6T+M0sySPjF32mSFQAK7UfAg8qGeRI6OM1GSBxDLwbXjkqy2NVdnqCedJcP1nC785JYg==
"@octokit/plugin-rest-endpoint-methods@5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.1.tgz#631b8d4edc6798b03489911252a25f2a4e58c594"
integrity sha512-vvWbPtPqLyIzJ7A4IPdTl+8IeuKAwMJ4LjvmqWOOdfSuqWQYZXq2CEd0hsnkidff2YfKlguzujHs/reBdAx8Sg==
dependencies:
"@octokit/types" "^6.13.0"
"@octokit/types" "^6.13.1"
deprecation "^2.3.1"
"@octokit/request-error@^2.0.0", "@octokit/request-error@^2.0.5":
@ -863,21 +863,21 @@
universal-user-agent "^6.0.0"
"@octokit/rest@^18.1.0":
version "18.5.2"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.5.2.tgz#0369e554b7076e3749005147be94c661c7a5a74b"
integrity sha512-Kz03XYfKS0yYdi61BkL9/aJ0pP2A/WK5vF/syhu9/kY30J8He3P68hv9GRpn8bULFx2K0A9MEErn4v3QEdbZcw==
version "18.5.3"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.5.3.tgz#6a2e6006a87ebbc34079c419258dd29ec9ff659d"
integrity sha512-KPAsUCr1DOdLVbZJgGNuE/QVLWEaVBpFQwDAz/2Cnya6uW2wJ/P5RVGk0itx7yyN1aGa8uXm2pri4umEqG1JBA==
dependencies:
"@octokit/core" "^3.2.3"
"@octokit/plugin-paginate-rest" "^2.6.2"
"@octokit/plugin-request-log" "^1.0.2"
"@octokit/plugin-rest-endpoint-methods" "5.0.0"
"@octokit/plugin-rest-endpoint-methods" "5.0.1"
"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.13.0", "@octokit/types@^6.7.1":
version "6.13.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.13.0.tgz#779e5b7566c8dde68f2f6273861dd2f0409480d0"
integrity sha512-W2J9qlVIU11jMwKHUp5/rbVUeErqelCsO5vW5PKNb7wAXQVUz87Rc+imjlEvpvbH8yUb+KHmv8NEjVZdsdpyxA==
"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.13.1", "@octokit/types@^6.7.1":
version "6.14.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.14.0.tgz#587529b4a461d8b7621b99845718dc5c79281f52"
integrity sha512-43qHvDsPsKgNt4W4al3dyU6s2XZ7ZMsiiIw8rQcM9CyEo7g9W8/6m1W4xHuRqmEjTfG1U4qsE/E4Jftw1/Ak1g==
dependencies:
"@octokit/openapi-types" "^6.0.0"
"@octokit/openapi-types" "^6.2.0"
"@tootallnate/once@1":
version "1.1.2"
@ -1207,9 +1207,9 @@ chalk@^2.0.0:
supports-color "^5.3.0"
chalk@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
version "4.1.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad"
integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
@ -2272,9 +2272,9 @@ is-ci@^2.0.0:
ci-info "^2.0.0"
is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==
version "2.3.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887"
integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==
dependencies:
has "^1.0.3"
@ -2522,25 +2522,25 @@ lerna@^4.0.0:
npmlog "^4.1.2"
libnpmaccess@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-4.0.1.tgz#17e842e03bef759854adf6eb6c2ede32e782639f"
integrity sha512-ZiAgvfUbvmkHoMTzdwmNWCrQRsDkOC+aM5BDfO0C9aOSwF3R1LdFDBD+Rer1KWtsoQYO35nXgmMR7OUHpDRxyA==
version "4.0.2"
resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-4.0.2.tgz#781832fb7ccb867b26343a75a85ad9c43e50406e"
integrity sha512-avXtJibZuGap0/qADDYqb9zdpgzVu/yG5+tl2sTRa7MCkDNv2ZlGwCYI0r6/+tmqXPj0iB9fKexHz426vB326w==
dependencies:
aproba "^2.0.0"
minipass "^3.1.1"
npm-package-arg "^8.0.0"
npm-registry-fetch "^9.0.0"
npm-package-arg "^8.1.2"
npm-registry-fetch "^10.0.0"
libnpmpublish@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-4.0.0.tgz#ad6413914e0dfd78df868ce14ba3d3a4cc8b385b"
integrity sha512-2RwYXRfZAB1x/9udKpZmqEzSqNd7ouBRU52jyG14/xG8EF+O9A62d7/XVR3iABEQHf1iYhkm0Oq9iXjrL3tsXA==
version "4.0.1"
resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-4.0.1.tgz#08ca2cbb5d7f6be1ce4f3f9c49b3822682bcf166"
integrity sha512-hZCrZ8v4G9YH3DxpIyBdob25ijD5v5LNzRbwsej4pPDopjdcLLj1Widl+BUeFa7D0ble1JYL4F3owjLJqiA8yA==
dependencies:
normalize-package-data "^3.0.0"
npm-package-arg "^8.1.0"
npm-registry-fetch "^9.0.0"
normalize-package-data "^3.0.2"
npm-package-arg "^8.1.2"
npm-registry-fetch "^10.0.0"
semver "^7.1.3"
ssri "^8.0.0"
ssri "^8.0.1"
lines-and-columns@^1.1.6:
version "1.1.6"
@ -2975,7 +2975,7 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-
semver "2 || 3 || 4 || 5"
validate-npm-package-license "^3.0.1"
normalize-package-data@^3.0.0:
normalize-package-data@^3.0.0, normalize-package-data@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.2.tgz#cae5c410ae2434f9a6c1baa65d5bc3b9366c8699"
integrity sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==
@ -2991,9 +2991,9 @@ normalize-url@^3.3.0:
integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==
npm-bundled@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b"
integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==
version "1.1.2"
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1"
integrity sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==
dependencies:
npm-normalize-package-bin "^1.0.1"
@ -3052,6 +3052,19 @@ npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1:
npm-package-arg "^8.1.2"
semver "^7.3.4"
npm-registry-fetch@^10.0.0:
version "10.1.1"
resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-10.1.1.tgz#97bc7a0fca5e8f76cc5162185b8de8caa8bea639"
integrity sha512-F6a3l+ffCQ7hvvN16YG5bpm1rPZntCg66PLHDQ1apWJPOCUVHoKnL2w5fqEaTVhp42dmossTyXeR7hTGirfXrg==
dependencies:
lru-cache "^6.0.0"
make-fetch-happen "^8.0.9"
minipass "^3.1.3"
minipass-fetch "^1.3.0"
minipass-json-stream "^1.0.1"
minizlib "^2.0.0"
npm-package-arg "^8.0.0"
npm-registry-fetch@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz#86f3feb4ce00313bc0b8f1f8f69daae6face1661"
@ -3099,9 +3112,9 @@ object-assign@^4.0.1, object-assign@^4.1.0:
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
object-inspect@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a"
integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==
version "1.10.2"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.2.tgz#b6385a3e2b7cae0b5eafcf90cddf85d128767f30"
integrity sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==
object-keys@^1.0.12, object-keys@^1.1.1:
version "1.1.1"
@ -3247,9 +3260,9 @@ p-waterfall@^2.1.1:
p-reduce "^2.0.0"
pacote@^11.2.6:
version "11.3.1"
resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.1.tgz#6ce95dd230db475cbd8789fd1f986bec51b4bf7c"
integrity sha512-TymtwoAG12cczsJIrwI/euOQKtjrQHlD0k0oyt9QSmZGpqa+KdlxKdWR/YUjYizkixaVyztxt/Wsfo8bL3A6Fg==
version "11.3.3"
resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.3.tgz#d7d6091464f77c09691699df2ded13ab906b3e68"
integrity sha512-GQxBX+UcVZrrJRYMK2HoG+gPeSUX/rQhnbPkkGrCYa4n2F/bgClFPaMm0nsdnYrxnmUy85uMHoFXZ0jTD0drew==
dependencies:
"@npmcli/git" "^2.0.1"
"@npmcli/installed-package-contents" "^1.0.6"
@ -3264,7 +3277,7 @@ pacote@^11.2.6:
npm-package-arg "^8.0.1"
npm-packlist "^2.1.4"
npm-pick-manifest "^6.0.0"
npm-registry-fetch "^9.0.0"
npm-registry-fetch "^10.0.0"
promise-retry "^2.0.1"
read-package-json-fast "^2.0.1"
rimraf "^3.0.2"
@ -3887,9 +3900,9 @@ socks-proxy-agent@^5.0.0:
socks "^2.3.3"
socks@^2.3.3:
version "2.6.0"
resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.0.tgz#6b984928461d39871b3666754b9000ecf39dfac2"
integrity sha512-mNmr9owlinMplev0Wd7UHFlqI4ofnBnNzFuzrm63PPaHgbkqCFe4T5LzwKmtQ/f2tX0NTpcdVLyD/FHxFBstYw==
version "2.6.1"
resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e"
integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==
dependencies:
ip "^1.1.5"
smart-buffer "^4.1.0"