I’ve been racking my brain & starting then scratching code for this issue for a hot minute. So basically what I am looking to do is add one of three classes based on morning, afternoon or evening in only EST (New York). It seems simple enough, it really does, but I’m just not able to figure this one out. I’ve deleted more code than I care to mention. Any help would be vastly appreciated, I’m sure if you’re reading this you already know world’s more than me. Thank you.
2
Answers
give that you have three different classes morning , afternoon and evening
you can do as below
I’m assuming you’re doing some kind of event or calendar view here.
With that in mind you could define your time of days to correspond to a range of hours:
You would extract the hour from each records timestamp, ie:
Then you loop the ranges with the hour to get the time of day:
Put it all together in a function: