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

Complex CFif feature

Guest
Aug 04, 2008 Aug 04, 2008
I have a chat feature that I only want to be available between the hours of 8:30 am to 4:30 pm. Right now I have this long cfif statement.
1. Is there an easier way to do this?
2. How can I combine if statements like if it is monday between 8:30 to 4:30 pm?
325
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
LEGEND ,
Aug 04, 2008 Aug 04, 2008
1) Google 'Boolean Logic' and discover the magic of the 'AND' and 'OR'
operators.

2) Take a look at the ColdFusion Function documentation for the list
functions, especially listFind() and possible listContains() functions.

3) You may also want to take a look at the date functions as well,
particularly dateCompare(). I.E. It is important to think that times
are just a portion of a date-time value.


SPOILER SPACE
.

..

...

....

.....

......

.......

........

.........

..........

<cfif DayOfWeek(tdate) GTE 2 AND DayOfWeek(tdate) LTE 6>
<!--- ON - day is Monday through Friday --->
<cfelse>
<!--- OFF - day is Saturday or Sunday --->
</cfif>

I leave it to the OP to work the time of the day into this if statement.

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
LEGEND ,
Aug 04, 2008 Aug 04, 2008
LATEST
> SPOILER SPACE

HAHAHAHAHAHAHAHAHAHAHA

I like it.

--
Adam
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