Skip to content

Commit

Permalink
Untracked: Fix prerequisite date time zones (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlang42 authored Jan 30, 2024
1 parent f8c500e commit 67b42fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Prerequisites.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function runPrerequisiteUpdatesForBoard(boardId, errorIfLocked) {
var state = loadPrerequisiteState(boardId);
var changes = updatePrerequisiteState(boardId, state);
var processed = null;
if (changes || (!!state.nextDatePrerequisite && state.nextDatePrerequisite < (new Date()).toString())) {
if (changes || (!!state.nextDatePrerequisite && state.nextDatePrerequisite < formatDateTasks(new Date()))) {
processed = processPrerequisiteState(boardId, state);
}
storePrerequisiteState(boardId, state);
Expand Down Expand Up @@ -168,7 +168,7 @@ function processPrerequisiteState(boardId, state) {
ready = false;
}
}
state.nextDatePrerequisite = nextDate;
state.nextDatePrerequisite = formatDateTasks(nextDate);
if (!taskState.due) {
// setTaskDueWithMessage() calls a task read, therefore only call if it might actually be useful
if (duplicates.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion app/Tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function updateTask(boardId,changes,afterTaskId) {
if(changes.list==board.properties.list_exit) {
// when done, dont label. this is important for recurring tasks
changes.status = "completed";
changes.completed = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "yyyy-MM-dd'T'HH:mm:ss'Z'");
changes.completed = formatDateTasks(new Date());
} else {
changes.list = includesIgnoreCase(board.properties.lists, changes.list); // to get correct case for list name
if(changes.list!=board.properties.list_entry) addListToName(changes, changes.list); // when todo, dont label. it looks nicer
Expand Down

0 comments on commit 67b42fb

Please sign in to comment.