From 5df35657e71fb17f9ceadbec2bf08afd17be4331 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Fri, 26 Aug 2022 20:49:18 +1200 Subject: [PATCH] Add a comment in fromUnixTime (#527) --- lib/ical/time.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ical/time.js b/lib/ical/time.js index 98d89943..9dc30602 100644 --- a/lib/ical/time.js +++ b/lib/ical/time.js @@ -863,6 +863,9 @@ */ fromUnixTime: function fromUnixTime(seconds) { this.zone = ICAL.Timezone.utcTimezone; + // We could use `fromJSDate` here, but this is about twice as fast. + // We could also clone `epochTime` and use `adjust` for a more + // ical.js-centric approach, but this is about 100 times as fast. var date = new Date(seconds * 1000); this.year = date.getUTCFullYear(); this.month = date.getUTCMonth() + 1;