Question

I am looking for a QR code that could add a Vcal event with: Start date and time: as of the date and time the code is scanned End date and time: exactly xx weeks after the start date (say 2 weeks)

Was it helpful?

Solution

In iCalendar, you can specify a duration inside a VEVENT with the DURATION property. (See section 4.3.6 of RFC 2445.) You can use this instead of DTEND. The syntax is a little hard to explain; you can see it in the RFC. DURATION:PT1H30M means 1 hour, 30 minutes. DURATION:P2W means two weeks.

So, you can just add this to the VEVENT you were already going to encode in a QR code.

Of course, whether a reader reads it correctly is another story. I can tell you that zxing does not read DURATION. Because I wrote it and I have just learned that DURATION exists. I will add it as a to-do to parse correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top