Correction du timezoneOffset
This commit is contained in:
parent
648fc3d0f4
commit
ebe10b3d69
1 changed files with 4 additions and 2 deletions
|
@ -724,12 +724,14 @@ async function exportConsolidatedTextToGit(
|
||||||
context.consolidatedIdsByActionByModifyingTextIdByDate,
|
context.consolidatedIdsByActionByModifyingTextIdByDate,
|
||||||
).toSorted(([date1], [date2]) => date1.localeCompare(date2))) {
|
).toSorted(([date1], [date2]) => date1.localeCompare(date2))) {
|
||||||
console.log(date)
|
console.log(date)
|
||||||
let timestamp = Math.floor(new Date(date).getTime() / 1000)
|
const dateObject = new Date(date)
|
||||||
|
const timezoneOffset = dateObject.getTimezoneOffset() // in minutes
|
||||||
|
let timestamp = Math.floor(dateObject.getTime() / 1000)
|
||||||
if (timestamp < minDateTimestamp) {
|
if (timestamp < minDateTimestamp) {
|
||||||
const diffDays = Math.round((minDateTimestamp - timestamp) / oneDay)
|
const diffDays = Math.round((minDateTimestamp - timestamp) / oneDay)
|
||||||
timestamp = minDateTimestamp - diffDays
|
timestamp = minDateTimestamp - diffDays
|
||||||
}
|
}
|
||||||
const timezoneOffset = 0
|
timestamp += timezoneOffset * 60
|
||||||
|
|
||||||
const modifyingTexteVersionArray: Array<
|
const modifyingTexteVersionArray: Array<
|
||||||
JorfTexteVersion | LegiTexteVersion | TexteManquant
|
JorfTexteVersion | LegiTexteVersion | TexteManquant
|
||||||
|
|
Loading…
Reference in a new issue