Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
EdmondsM #1
Display name based on date
Hi All, I am trying to put together a cfm page that will display a users name
based on the day of the week. The user selects a range of dates that they want
their name on the list, their name should only show Monday thru Friday. is
there an easy way to accomplish this in CFM?? I hope I made this clear.
Thanks iin advance
EdmondsM Guest
-
get record based on date time
HI Im creating a site that generates leads. When a lead is generated it will select a broker in the list based on certain criteria. The thing i... -
HELP: variable increment based on date
Koncept <user@unknown.invalid> writes: Try this: (assuming the event happened September 1st) $start = mktime (0,0,0,9,1,2004); $now =... -
selecting based on a month in a date
Hi, Asked this on the mySQL list but it seems to be more of a PHP syntax thing that a mySQL thing. In have the following line in PHP <?php... -
Find Files Based off of Date
Does anyknow know how to get all the files in a directory based off of creation date (this will be in Windows, unfortunately). For example, get... -
If statement based on current date
I tried the code below and after adjusting it to get around some syntax errors I got nothing. It just runs the queries without even considering... -
zoeski80 #2
Re: Display name based on date
you can use the DayOfWeek function eg. #DayOfWeek(now())# which will return a
number from 1(Sunday) to 7(Saturday) to tell you which day of the week it is.
There is also a DayOfWeekAsString which will actually return the name of the
day.
So you can do a CFIF or CFSWITCH on the days of the week to determine whether
to show a users name or not.
HTH
Zoe
zoeski80 Guest
-
EdmondsM #3
Re: Display name based on date
Hi Zoe, I have gotten that to work since I posted my message using the
DayOfWeek. What I trying to achieve now is if the user selects 3/1/05 -
3/31/05, is there a way to list the numbers out as 1 thru 7. It would continue
to do this until it has reached the total number of days. Thanks in advance.
EdmondsM Guest
-
zoeski80 #4
Re: Display name based on date
Hi EdmondsM
I am not really sure what you are doing.
Are you showing a calendar and peoples names are supposed to appear only on
the days they selected?
Do you have some sample code that you can post that shows how you're trying to
show these dates/users.
Zoe
zoeski80 Guest
-
EdmondsM #5
Re: Display name based on date
It is not really going to be a calendar per say. What is supposed to happen is
then a doctor come to the page he is going to sign up for on month of service.
The weekends they are not on call so those dates need to either blank or in the
future they maybe fill with a weekend on call doc. So it should look
something like the following.
Date Day Doc Name 1 some
doc name 2 another doc name 3 one more doc
name and so on. So if the doc only selects the first two weeks to be on call
then 1 - 14. Making since??
EdmondsM Guest
-
The ScareCrow #6
Re: Display name based on date
The attached code should give you a heads up.
Ken
<cfset NumberOfDays = DateDiff(datepart, startDate, endDate)>
<cfset loopTo = NumberOfDays - 1>
<cfloop from="0" to="#loopTo#" index="idx">
<cfif DayOfWeek(DateAdd("d", idx, startDate) GT 1 And DayOfWeek(DateAdd("d",
idx, startDate) LT 6>
Display Name
</cfif>
</cfloop>
The ScareCrow Guest
-
EdmondsM #7
Re: Display name based on date
ScareCrow, thanks. With a couple of tweaks I got it to work.
EdmondsM Guest



Reply With Quote

