iCalendar Opening Hours - frequency

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):
from 8:00AM to 5:00PM
(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)?

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 ?
Edit 2:
Setting TRANSP:TRANSPARENT marks this event as free time in a calendar (or "not busy")

Related

DatePickerIOS, in april and may show wrong date for 1976. React native

When picking a date in april and may for 1976, always show 1 day before on calander. However, in other months it comes true.
How we can handle this issue ?

What is the right way to save time values in Rails 5

I'll have to save various working hours (open and closes) and wonder what is the best format/way to use ?
Sure I can choose to have time time as DB type for these values and format the DB time like that:
Time.current.to_s(:time)
=> "15:52"
Instead of Time.current I'll be select the corresponding time value from the DB:
Thu, 12 Apr 2018 15:48:28 UTC +00:00
But what is solution to choose for a User to enter time values in the front-end ? Moreover, I'll have to either choose a general format for hours, like
07:30
Or (it the requirement changes) enable a locale-dependent format like this:
7ч30 (for Russia)
7h30 (for France)
etc..
Any ideas and tips ? Thank you.
I'd store "seconds from midnight", so 15:52 would be stored as the integer 57120. Then I'd write a custom type see the attribute docs for more details that converts to/from that integer.
Then I'd just have different formats in the locale file that I'd use for that conversion.

later.js every nth weekday of every month

I am using later.js (meteor package, voidale:later-js-tz#1.1.9) to schedule events, using the later.parse.text() parser.
I can schedule weekly events on a given weekday with no problem, with strings like 'at 11:00 on Monday'.
But I get parse errors trying things like 'at 11:00 on every second Monday of every month'.
Q: Is there a way to do this in later.js, or if not, is there a javascript library available that does support this?
Thanks.
I found moment-recur, which supports this nth-weekday of a month in its API, but doesn't have a text parser.
I then used PEGjs to build a text parser which outputs the necessary parameters, which I use in a straightforward way to call the moment-recur API.

How to search a given time range for every day in Splunk?

I am trying to search for an event that happens in a specific time range in Splunk but I want that search to encompass all of the data I have indexed which covers a wide date range.
For example, I want to see if a line in an indexed log file contains the word 'Error' between the hours of 9am and 4pm from the 25 days worth of logs I have indexed. If the word 'Error' shows up outside of that time range, I don't want that displayed in my search results.
For date/time format I am using mm/dd/yyyy:hh:mm:ss
Any ideas how I might go about this?
You can try a search something like this:
index=foo earliest=-25d (date_hour > 9 and date_hour < 16) "Error"
while the selected answer is great, it did not work in my case (splunk v6), however this did work (it was mainly adding the | eval date_hour... )
and my full working search (between hours of 6am to 11pm , for each of the prior 25 days):
index=mymts earliest=-25d | eval date_hour=strftime(_time, "%H") | search date_hour>=6 date_hour<=23 host="172.17.172.1" "/netmap/*"
hope this helps others.

Adding a 0 to the Time in a VB Console Application

I have created a console application in VB.Net that adds 2 times together and then displays the output of the final time. I've managed to get it working after much work but I have a problem:
Sometimes when I calculate the time and the end result is below '10 mins', it doesn't include the "0" in front of the minutes. I say this because all numbers under 10 mins on a clock are like 09, 08, 07, etc..
For example, I do 2:05 + 1:02 which the answer is meant to be 3:07 instead it comes out as 3:7. Another example would be I do 1:00 + 2:00 and the output is 3:0 when its meant to be 3:00.
Can anyone help me figure out this problem?
Format the number using a custom format. Example:
Dim minuteString as String = minutes.ToString("00")