fix: 🐛 Added luxon to fix getSchedule (#13)

This commit is contained in:
Johan Öbrink 2021-04-20 10:19:23 +02:00 committed by GitHub
parent 2ae212d46a
commit fe1729c872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -19,6 +19,7 @@
"publish-package": "npm publish --access public"
},
"dependencies": {
"luxon": "^1.26.0",
"react-redux": "^7.2.3",
"redux": "^4.0.5"
},
@ -35,6 +36,7 @@
"@testing-library/react": "^11.2.6",
"@testing-library/react-hooks": "^5.1.1",
"@types/jest": "^26.0.22",
"@types/luxon": "^1.26.4",
"@types/react": "^16.14.3",
"@types/react-redux": "^7.1.16",
"@typescript-eslint/eslint-plugin": "^4.21.0",

View File

@ -14,6 +14,7 @@ import {
TimetableEntry,
User,
} from '@skolplattformen/embedded-api'
import { DateTime } from 'luxon'
import {
ApiCall,
EntityHookResult,
@ -175,7 +176,7 @@ export const useSchedule = (child: Child, from: string, to: string) => hook<Sche
`schedule_${child.id}_${from}_${to}`,
[],
(s) => s.schedule,
(api) => () => api.getSchedule(child, from, to),
(api) => () => api.getSchedule(child, DateTime.fromISO(from), DateTime.fromISO(to)),
)
export const useTimetable = (child: Skola24Child, week: number, year: number) => hook<TimetableEntry[]>(

View File

@ -1470,6 +1470,11 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
"@types/luxon@^1.26.4":
version "1.26.4"
resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-1.26.4.tgz#77bbd5a1aa74ca31edff2aee4f8313ea0d93ca5c"
integrity sha512-OIvbVLZQUjyZofqSFpre2VsgvKy0V0JQdRgN0k3H1DTGRdxHiaQjT16+H2gyuhAS9r8B2PQEwrSiqP6/Zka3pQ==
"@types/node@*":
version "14.14.25"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz"
@ -4553,6 +4558,11 @@ luxon@^1.25.0:
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.25.0.tgz#d86219e90bc0102c0eb299d65b2f5e95efe1fe72"
integrity sha512-hEgLurSH8kQRjY6i4YLey+mcKVAWXbDNlZRmM6AgWDJ1cY3atl8Ztf5wEY7VBReFbmGnwQPz7KYJblL8B2k0jQ==
luxon@^1.26.0:
version "1.26.0"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.26.0.tgz#d3692361fda51473948252061d0f8561df02b578"
integrity sha512-+V5QIQ5f6CDXQpWNICELwjwuHdqeJM1UenlZWx5ujcRMc9venvluCjFb4t5NYLhb6IhkbMVOxzVuOqkgMxee2A==
lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz"