@timesheet/plugin-google-calendar 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/taskSync.js +8 -4
- package/manifest.json +1 -1
- package/package.json +1 -1
package/dist/lib/taskSync.js
CHANGED
|
@@ -318,10 +318,10 @@ function toTaskDateRange(event) {
|
|
|
318
318
|
let endRaw = event.end?.dateTime;
|
|
319
319
|
// Handle all-day events (date field instead of dateTime)
|
|
320
320
|
if (!startRaw && event.start?.date) {
|
|
321
|
-
startRaw = `${event.start.date}T00:00:
|
|
321
|
+
startRaw = `${event.start.date}T00:00:00+00:00`;
|
|
322
322
|
}
|
|
323
323
|
if (!endRaw && event.end?.date) {
|
|
324
|
-
endRaw = `${event.end.date}T00:00:
|
|
324
|
+
endRaw = `${event.end.date}T00:00:00+00:00`;
|
|
325
325
|
}
|
|
326
326
|
if (!startRaw || !endRaw) {
|
|
327
327
|
return null;
|
|
@@ -332,8 +332,8 @@ function toTaskDateRange(event) {
|
|
|
332
332
|
return null;
|
|
333
333
|
}
|
|
334
334
|
return {
|
|
335
|
-
startDateTime: start
|
|
336
|
-
endDateTime: end
|
|
335
|
+
startDateTime: toTimesheetDateTime(start),
|
|
336
|
+
endDateTime: toTimesheetDateTime(end)
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
function buildGoogleEventPayload(task) {
|
|
@@ -493,6 +493,10 @@ async function ensureWatchChannels(context) {
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
+
/** Format a Date to the offset format the Timesheet backend expects: yyyy-MM-dd'T'HH:mm:ss+00:00 */
|
|
497
|
+
function toTimesheetDateTime(date) {
|
|
498
|
+
return date.toISOString().replace(/\.\d{3}Z$/, '+00:00');
|
|
499
|
+
}
|
|
496
500
|
function readMetadataString(metadata, key) {
|
|
497
501
|
const value = metadata[key];
|
|
498
502
|
if (typeof value === 'string' && value.trim().length > 0) {
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "google-calendar-sync",
|
|
3
3
|
"name": "Google Calendar Sync",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"description": "Synchronize Timesheet tasks with Google Calendar",
|
|
6
6
|
"longDescription": "Bidirectional synchronization between Timesheet tasks and Google Calendar events.",
|
|
7
7
|
"icon": "google-calendar",
|