Browse Source
Merge pull request #5873 from Budibase/fix/5731
Fix for external DB date only columns in various timezones
master
Michael Drury
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
0 deletions
-
packages/bbui/src/Form/Core/DatePicker.svelte
|
|
|
@ -58,6 +58,11 @@ |
|
|
|
if (timeOnly) { |
|
|
|
newValue = `2000-01-01T${newValue.split("T")[1]}` |
|
|
|
} |
|
|
|
// date only, offset for timezone so always right date |
|
|
|
else if (!enableTime) { |
|
|
|
const offset = dates[0].getTimezoneOffset() * 60000 |
|
|
|
newValue = new Date(dates[0].getTime() - offset).toISOString() |
|
|
|
} |
|
|
|
dispatch("change", newValue) |
|
|
|
} |
|
|
|
|
|
|
|
|