Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiS1 committed Sep 23, 2023
1 parent 0d68883 commit 1e50a10
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -79,16 +79,16 @@ const NewTimelineModal: React.FC<NewTimelineModalProps> = observer(({ timelineIt
historicalContextStore.fetchHistoricalContextAll();
}, []);

const GetLocalHoursOffset = (date: Date) => -1 * date.getTimezoneOffset();
const GetLocalMinutesOffset = (date: Date) => -1 * date.getTimezoneOffset();

const GetDateBasedOnFormat = (date: Date) => {
let seconds = 0;
// specific GMT+202 Ukraine timezone before 1/5/1924, where seconds are truncated by browser
if(GetLocalHoursOffset(date) == 122)
if(GetLocalMinutesOffset(date) == 122)
{
seconds = 4;
}
date.setHours(0, GetLocalHoursOffset(date), seconds, 0);
date.setHours(0, GetLocalMinutesOffset(date), seconds, 0);
switch (dateTimePickerType) {
case 'date':
return date.toISOString();

0 comments on commit 1e50a10

Please sign in to comment.