mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 12:03:03 +00:00
Stop using localized Dates. Ensure we always use UTC dates, as the backend expects/uses UTC.
This commit is contained in:
@@ -244,9 +244,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges {
|
||||
if (metadataModel.type === DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER) {
|
||||
const date = new Date(accessCondition[key]);
|
||||
metadataModel.value = {
|
||||
year: date.getFullYear(),
|
||||
month: date.getMonth() + 1,
|
||||
day: date.getDate()
|
||||
year: date.getUTCFullYear(),
|
||||
month: date.getUTCMonth() + 1,
|
||||
day: date.getUTCDate()
|
||||
};
|
||||
} else {
|
||||
metadataModel.value = accessCondition[key];
|
||||
@@ -302,9 +302,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges {
|
||||
|
||||
const min = new Date(accessCondition.maxStartDate);
|
||||
startDateModel.max = {
|
||||
year: min.getFullYear(),
|
||||
month: min.getMonth() + 1,
|
||||
day: min.getDate()
|
||||
year: min.getUTCFullYear(),
|
||||
month: min.getUTCMonth() + 1,
|
||||
day: min.getUTCDate()
|
||||
};
|
||||
}
|
||||
if (accessCondition.hasEndDate) {
|
||||
@@ -314,9 +314,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges {
|
||||
|
||||
const max = new Date(accessCondition.maxEndDate);
|
||||
endDateModel.max = {
|
||||
year: max.getFullYear(),
|
||||
month: max.getMonth() + 1,
|
||||
day: max.getDate()
|
||||
year: max.getUTCFullYear(),
|
||||
month: max.getUTCMonth() + 1,
|
||||
day: max.getUTCDate()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user