>- see footer for list info -<
cflib is your friend ;-)




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Connolly
Sent: 09 December 2004 13:01
To: Coldfusion Development
Subject: RE: [CF-Dev] 1=Monday, not Sunday

>- see footer for list info -<
Nice one Neil!

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: 09 December 2004 12:08
To: Coldfusion Development
Subject: RE: [CF-Dev] 1=Monday, not Sunday


>- see footer for list info -<
This may be of some use..

http://www.cflib.org/udf.cfm?ID=155




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Aidan Whitehall
Sent: 09 December 2004 11:41
To: Coldfusion Development
Subject: RE: [CF-Dev] 1=Monday, not Sunday

>- see footer for list info -<
> Are you trying to get DayOfWeek and DayOfWeekAsString to return
different ordinal
> values in all cases?
> 
> If so you could try writing a simple alternative DayOfWeek function to
handle this.

Yeah, that's a good idea.

The situation is that I'm writing some scheduler code that allows users
to select one or more days of the week and (separately) months of the
year. The database against which I'm working stores a bitmask of the
days selected, but where 1=Monday ~ 7=Sunday (so 5 = Monday and
Wednesday).

However, having asked the question and rolled up the old shirt-sleeves,
I think that worrying about changing the date values isn't probably the
way to go.

So far, I've got a generic bitmask component (below) and am about to
write getValues(), which I suspect should probably return a 1D array of
powers of 2 that make up the current bitmask value. Then, when storing
the values, I can supply addValue() not with the direct value of 1~7,
but with the whatever value is stored in it's position in a 2D array
like this

[1] = 7
[2] = 1

[7] = 6

which will allow me to offset the days. Not having done this before, I'm
slightly winging it (and am probably coming across as a bit
harf-assed)...


<cfcomponent output="no">
        <cfset setBitmask(0)>
        
        <cffunction name="addValue" returntype="void" output="false">
                <cfargument name="iValue" type="numeric" required="yes">
                <cfset setBitmask(getBitmask() + (2 ^
arguments.iValue))>
        </cffunction>

        <cffunction name="getBitmask" returntype="numeric"
output="false">
                <cfreturn variables.iBitmask>
        </cffunction>
        
        <cffunction name="getValues" returntype="void" output="false">

        </cffunction>
        
        <cffunction name="setBitmask" returntype="void" output="false">
                <cfargument name="iBitmask" type="numeric"
required="yes">
                <cfset variables.iBitmask = arguments.iBitmask>
        </cffunction>
</cfcomponent>



-- 
Aidan Whitehall   [EMAIL PROTECTED]
Macromedia ColdFusion Developer
Fairbanks Environmental   +44 (0)1695 51775

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<




_______________________________________________________________________
Confidentiality:  This e-mail and its attachments are intended for the above
named only and may be confidential.  If they have come to you in error you
must take no action based on them, nor must you copy or show them to anyone;
please reply to this e-mail and highlight the error.

Security Warning:  Please note that this e-mail has been created in the
knowledge that Internet e-mail is not a 100% secure communications medium.
We advise that you understand and observe this lack of security when
e-mailing us.

Viruses:  Although we have taken steps to ensure that this e-mail and
attachments are free from any virus, we advise that in keeping with good
computing practice the recipient should ensure they are actually virus free.
________________________________________________________________________
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to