|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Months in a Quarter
Is there a way I can find out what months are in each Quarter of the year? I know that by doing Quarter(now()) will give me 1-4 depending on what quarter we are in. I was just curious if there was a way to display the months depending on which quarter we are in.
__________________
http://www.dieselstudios.com - http://www.trackmycash.com - http://www.hamptonsoftrentdale.com |
|
#2
|
|||
|
|||
|
Here is a simple function that will do it:
Code:
<cffunction name="getMonthsInQuarter" access="public" returntype="array" output="false" hint=""> <cfargument name="quarter" type="numeric" required="false" default="#Quarter(Now())#" /> <cfset var local = StructNew() /> <cfset local.months = ArrayNew(1) /> <cfset ArrayAppend(local.months, (arguments.quarter * 3)-2) /> <cfset ArrayAppend(local.months, (arguments.quarter * 3)-1) /> <cfset ArrayAppend(local.months, (arguments.quarter * 3)) /> <cfreturn local.months /> </cffunction>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Months in a Quarter |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|