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

#860 Fix DateInput component not allowing datetime #861

Merged
merged 1 commit into from
Sep 16, 2020
Merged
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
5 changes: 2 additions & 3 deletions src/components/Form/DateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ export default {
const day = this.type === 'month' ? 1 : this.day;
const month = this.month;
const year = this.year;
const hour = this.type === 'datetime' ? this.hour : 0;
const hour = this.type === 'datetime' ? this.hour : 13; // default time to 1pm. this avoids BST issue we would have if we defaulted to 0
const minute = this.type === 'datetime' ? this.minute : 0;

if (!day || !month || !year) {
return null;
}
Expand All @@ -219,7 +218,7 @@ export default {
if (this.dateConstructor === null) {
return null;
} else {
return new Date(Date.UTC(...this.dateConstructor));
return new Date(...this.dateConstructor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed this to UTC because we were having issues with 29/03/2020 which is the date that GMT becomes BST. WE need to test this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
},
set(value) {
Expand Down