iCalendar Opening Hours

谁说我不能喝 提交于 2019-12-25 00:38:03

问题


How do you write a FREQ rule in iCalendar data format for store's opening hours ?

Let's say the store is open every working day (Mon-Fri):

  1. from 8:00AM to 5:00PM
  2. (or with lunch break from) 8:00AM to 11:00AM and 12:00PM to 5:00PM

This would solve the days: FREQ=WEEKLY;WKST=MO;BYDAY=MO,TU,WE,TH,FR, how about the hours though ?

Edit: Could I do sth like this?

DTSTART;TZID=America/New_York:19970902T080000
RRULE:FREQ=WEEKLY;WKST=MO;BYDAY=MO,TU,WE,TH,FR
DURATION=PT9H

Would this mean every day from Monday to Friday, from 8:00AM till 5:00PM (thanks to duration)?


回答1:


I think I solved it with DTSTART and DTEND like this:

BEGIN:VEVENT
...
DTSTAMP:20191016T133700Z
DTSTART;TZID=Europe/Bratislava:20191007T080000
DTEND;TZID=Europe/Bratislava:20191007T170000
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
SUMMARY:Opening hours without lunch break
...
END:VEVENT

And I think if I wanted to have opening hours with a lunch break, I'd have to create two separate events.

I believe using DURATION (as mentioned in Question) would also be an option:

BEGIN:VEVENT
...
DTSTAMP:20191016T133700Z
DTSTART;TZID=Europe/Bratislava:20191007T080000
DURATION:PT9H
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
SUMMARY:Opening hours without lunch break
...
END:VEVENT

Edit:

This however marks an event in calendar, I'd like this time to be marked as free time probably. Maybe sth with FREEBUSY ?

Would setting TRANSP:TRANSPARENT mark this event as free time?



来源:https://stackoverflow.com/questions/58413821/icalendar-opening-hours

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!