cal.diy icon indicating copy to clipboard operation
cal.diy copied to clipboard

ICS event is off by one month

Open slb235 opened this issue 5 years ago • 1 comments

Issue Summary

ics files have the wrong date (1 month to early).

Steps to Reproduce

  1. Create event
  2. Download ics or download ics attachement

Technical details

  • dayjs uses 0 index month (jan = 0)
  • ics uses 1 index month (jan = 1)

Hotfix

start: date.utc().toArray().slice(0, 6)

to

start: date.utc().toArray().slice(0, 6).map((v, i) => i === 1 ? v + 1 : v)

slb235 avatar Jun 14 '21 14:06 slb235

Thanks for investigating this! I'll implement this hotfix today, not a fan of the choice to 1-index on ICS's part.

emrysal avatar Jun 14 '21 14:06 emrysal