Skip to content

Commit

Permalink
replace gmt with utc
Browse files Browse the repository at this point in the history
  • Loading branch information
PeronGH committed Jun 22, 2023
1 parent 9e644c3 commit 3db6ce7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion date.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type Zone = "local" | "gmt";
export type Zone = "local" | "utc";

export const short_utc = (utc_ts: number) =>{
const utc = new Date(utc_ts),
Expand Down
4 changes: 2 additions & 2 deletions main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Deno.test('UTC event',
beginDate: [2022, 8, 1, 10, 10],
endDate: [2022, 8, 1, 11, 10],
desc: 'Hello',
zone: 'gmt' // Universal time required
zone: 'utc' // Universal time required
};
const evt = new Event(cfg);
const lines = evt.toLines()
assertEquals(lines[0][0], "BEGIN")
assertEquals(lines[0][1], "VEVENT")

// Note 'Z' suffix for GMT (precaution against daylight saving time surprises)
// Note 'Z' suffix for UTC (precaution against daylight saving time surprises)
assertEquals(lines[3], ["DTSTART", "20220801T101000Z"])
assertEquals(lines[4], ["DTEND", "20220801T111000Z"])

Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Event {
const result = [
eventBegin,
['UID', uid],
['DTSTAMP', parseDate(new Date(), "gmt")],
['DTSTAMP', parseDate(new Date(), "utc")],
['DTSTART', parseDate(this.config.beginDate, this.zone)],
['DTEND', parseDate(this.config.endDate!, this.zone)],
['SUMMARY', title],
Expand Down

0 comments on commit 3db6ce7

Please sign in to comment.