Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUPP0RT-1586: fix date bug, remove valueAsDate as it is null #251

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ All notable changes to this project will be documented in this file.
- Make the station selector call new api
- Add config to context in app.jsx

## [2.0.3] - 2024-08-01

- [#243](https://github.com/os2display/display-admin-client/pull/251)
- Fix null bug: replace valueAsDate with target.value as valueAsDate was null

## [2.0.2] - 2024-04-25

Expand Down
8 changes: 2 additions & 6 deletions src/components/util/schedule/schedule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,8 @@ function Schedule({ schedules, onChange }) {
* @param {object} target - Input target.
*/
const setDateValue = (scheduleId, target) => {
const date = target.valueAsDate;
const scheduleDate = new Date(
date.getTime() + 60 * 1000 * date.getTimezoneOffset()
);

changeSchedule(scheduleId, target.id, scheduleDate);
const date = new Date(target.value);
changeSchedule(scheduleId, target.id, date);
};

/**
Expand Down
Loading