Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Loop through 24 clock

Participant ,
Apr 21, 2008 Apr 21, 2008
Hi Folks,

Can anyone help me loop through the 24hr clock, as intervals of 15 minutes?

I'm designing a calendar and I need to assign events at 15 inute intervals.

Thankyou
503
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Apr 21, 2008 Apr 21, 2008
How are the events stored? Are they all visible in myarray?

Looking at your code, you step through the hours, but never check anything but the 3rd and 4th sub-element of the last element of the 2D array myarray (ie. myarray[ ArrayLen(myarray)][3] and myarray[ ArrayLen(myarray)][4]).

Also, is there only one event possible for each 15 minute interval?

CR
Translate
Contributor ,
Apr 21, 2008 Apr 21, 2008
Use either 2 or 3 drop down boxes.

Hour -> 00 - 23 (or 1 - 12)
Minutes -> 00, 15, 30, 45
AM/PM -> AM, PM (if you used the 12 hour drop down)

They only have the option of selecting a 15 minute interval no matter what they select and your drop down will not be 100's of options.

CR
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 21, 2008 Apr 21, 2008
Thanks for the reply.

Its for displaying the slots booked in a table, I can loop through the hours easily enough, Its the15 minutes intervals I'm stuck with.


<cfloop from="0" to="23" index="i">
<cfset indexdate = createDatetime(year(currentdate), month(currentdate), day(currentdate),i,0,0)>
<tr>
<td>#i#</td>
<td>
<cfif (myarray[ArrayLen(myarray)][3] lte indexdate and myarray[ArrayLen(myarray)][4] gte indexdate><h3>booked</h3>
</cfif></td>
</tr>
</cfloop>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 21, 2008 Apr 21, 2008
LATEST
How are the events stored? Are they all visible in myarray?

Looking at your code, you step through the hours, but never check anything but the 3rd and 4th sub-element of the last element of the 2D array myarray (ie. myarray[ ArrayLen(myarray)][3] and myarray[ ArrayLen(myarray)][4]).

Also, is there only one event possible for each 15 minute interval?

CR
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources