Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
ky_loh #1
How to get week of the month? Thank you
I would like to get the week of the month, but I cant found any thing function
only "week of the year"
Such as every month we have 4 weeks, i would like to know which week of the
month.
Thank you. Your help is very appreciated.
Dave
ky_loh Guest
-
count - day, week, month totals - HOW????
does anyone know how to do a count for getting totals for today, week, month. Example. i submit a job request form. i need to know running totals... -
count for today, week, month totals
does anyone know how to do a count for getting totals for today, week, month. Example. i submit a job request form. i need to know running totals... -
Can I change view from month to week in calendar control ?????
I want to make a week view and day view just like month view calendar control in .NET. if any one knows how to do that or any one has the source... -
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook
Hi!! Did Infragistics or some other company else provide a web calendar conrol with the features and look of Microsoft Outlook calendar? I mean... -
to convert a month to previous month
How to convert a month to previous month in a very easy way? For example, I have AUGUST, but I want JULY to return. Thanks. *** Sent via... -
PaulH #2
Re: How to get week of the month? Thank you
i'm afraid it's more complicated than that, it depends i guess on which
calendar (gregorian, persian, japanese, chinese, islamic) and how you define a
"week" within a month. for the gregorian calendar, java can have from 0 to 6
weeks in a month depending on how short the first week is & when the month
starts(simple example below). if you just want 4 weeks per month no matter what
then i guess the 2nd example.
<!--- real week of month --->
<cfscript>
calendar=createObject("java","java.util.GregorianC alendar");
calendar.setTime(now()); //your date goes here
weekOfMonth=calendar.get(calendar.WEEK_OF_MONTH);
writeoutput(weekOfMonth);
</cfscript>
<!--- 4 weeks per month --->
<cfscript>
function weekOfMonth(thisDate) {
var thisDay=day(thisDate);
var thisWeek=0;
if (thisDay LTE 7)
thisWeek=1;
else if (thisDay GT 7 AND thisDay LTE 14)
thisWeek=2;
else if (thisDay GT 14 AND thisDay LTE 21)
thisWeek=3;
else
thisWeek=4;
return thisWeek;
}
writeoutput(#weekOfMonth(now())#);
</cfscript>
PaulH Guest
-
ky_loh #3
Re: How to get week of the month? Thank you
that what i want....billion...thank you so much
ky_loh Guest



Reply With Quote

