Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
muness committed Dec 26, 2023
2 parents 3509440 + d0a15e2 commit 7d63801
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import {
} from "obsidian-daily-notes-interface";
import { amTaskWatcher } from "./amTaskWatcher";
import { AddTaskModal } from "./addTaskModal";
import { time } from "console";

let noticeTimeout: NodeJS.Timeout;
function getAMTimezoneOffset() {
return new Date().getTimezoneOffset() * -1;
}

const animateNotice = (notice: Notice) => {
let message = notice.noticeEl.innerText;
Expand All @@ -37,7 +40,7 @@ const animateNotice = (notice: Notice) => {
message = message.replace(" ...", " ");
}
notice.setMessage(message);
noticeTimeout = setTimeout(() => animateNotice(notice), 500);
setTimeout(() => animateNotice(notice), 500);
};

const CONSTANTS = {
Expand Down Expand Up @@ -164,7 +167,7 @@ export default class AmazingMarvinPlugin extends Plugin {

let requestBody: any = {
title: taskTitle,
timeZoneOffset: new Date().getTimezoneOffset(),
timeZoneOffset: getAMTimezoneOffset(),
};

if (catId && catId !== '' && catId !== 'root' && catId !== '__inbox-faux__') {
Expand Down Expand Up @@ -222,7 +225,7 @@ export default class AmazingMarvinPlugin extends Plugin {
const opt = this.settings;
const requestBody = {
itemId: taskId,
timeZoneOffset: new Date().getTimezoneOffset()
timeZoneOffset: getAMTimezoneOffset()
};

try {
Expand Down

0 comments on commit 7d63801

Please sign in to comment.