1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

feat(lang): more localization(#2219)

* feat(lang): localize some views

* fix: typo

* fix: Localization broke bug report generation

* feat(lang): localize recipe page instructions
This commit is contained in:
sephrat 2023-03-21 20:45:27 +01:00 committed by GitHub
parent 6b63c751b1
commit 9fd1ba6e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 362 additions and 226 deletions

View file

@ -99,11 +99,16 @@ function pad(num: number, size: number) {
return numStr;
}
export function timeUTCToLocal(time: string): string {
export function timeUTC(time: string): Date {
const [hours, minutes] = time.split(":");
const dt = new Date();
dt.setUTCMinutes(Number(minutes));
dt.setUTCHours(Number(hours));
return dt;
}
export function timeUTCToLocal(time: string): string {
const dt = timeUTC(time);
return `${pad(dt.getHours(), 2)}:${pad(dt.getMinutes(), 2)}`;
}