| Package | com.keepcore.calendar.model |
| Class | public class DateRange |
| Inheritance | DateRange Object |
| Property | Defined By | ||
|---|---|---|---|
| duration : Number
Return the duration between begin and end of the date range (in ms). | DateRange | ||
| endDate : Date
Date range end date. | DateRange | ||
| startDate : Date
Date range start date. | DateRange | ||
| valid : Boolean [read-only]
Return if the date range is valid (ie: start date lower than end date)
| DateRange | ||
| Method | Defined By | ||
|---|---|---|---|
DateRange(startDate:Date = null, endDate:Date = null)
Contructor. | DateRange | ||
[static]
Add two ranges. | DateRange | ||
Returns a clone of the date range. | DateRange | ||
contains(date:Date):Boolean
Return if the given date is contained in the current DateRange
we just compare the date (and not the time)because this function helps to know if an item is contained
in a calendar day cell
| DateRange | ||
containsRange(range:DateRange):Boolean
Return if the given range is contained in the current DateRange. | DateRange | ||
defineDayRange(date:Date):void
Set date range to the day of the given date
| DateRange | ||
defineMonthRange(date:Date):void
Set date range to the month of the given date
| DateRange | ||
defineWeekRange(date:Date):void
Set date range to the current week of the given date. | DateRange | ||
defineYearRange(date:Date):void
Set date range to the year of given date. | DateRange | ||
Check if date range equals the given date range by comparing startDate & endDate. | DateRange | ||
| DateRange | |||
getDurationInDays():int
Return the duration in days of the date range
Important note: full day event are described with a end date set at day+1 but with 00:00 as hour/minutes
| DateRange | ||
getDurationInHours(splitToDayEnd:Boolean = false, splitToDayStart:Boolean = false):Number
Return the duration between begin and end of the date range (in hours). | DateRange | ||
getPertinentDate():Date
Returns a clone of:
the startDate if not null
else the endDate if not null
or the current date
| DateRange | ||
Returns the data range representing the intersection between current range and given one. | DateRange | ||
mergeRanges(ranges:ArrayCollection):ArrayCollection [static]
Merge an array of ranges: ranges with intersections are merged leading to a new array of ranges. | DateRange | ||
moveTo(newStart:Date):void
Move the current range to the new start date (move also the end date). | DateRange | ||
rangeMonthSpan():int
Return the duration of the date range in months. | DateRange | ||
rangeWeekSpan():int
Return the duration of the date range in weeks. | DateRange | ||
toString():String
Returns the string representation of the date range, i.e: 30/01/2010 18:45 -- 27/02/2010 00:10
| DateRange | ||
| duration | property |
duration:NumberReturn the duration between begin and end of the date range (in ms). If set, endDate is modified to startDate + duration.
public function get duration():Number public function set duration(value:Number):void| endDate | property |
endDate:DateDate range end date.
public function get endDate():Date public function set endDate(value:Date):void| startDate | property |
startDate:DateDate range start date.
public function get startDate():Date public function set startDate(value:Date):void| valid | property |
valid:Boolean [read-only] Return if the date range is valid (ie: start date lower than end date)
public function get valid():Boolean| DateRange | () | Constructor |
public function DateRange(startDate:Date = null, endDate:Date = null)Contructor. Initialize startDate & endDate. Note: dates are cloned to avoid keeping references on given dates and changes them upon date range modifications.
ParametersstartDate:Date (default = null) | |
endDate:Date (default = null) |
| addRanges | () | method |
public static function addRanges(range1:DateRange, range2:DateRange):DateRangeAdd two ranges.
Parameters
range1:DateRange — first range
| |
range2:DateRange — second range
|
DateRange — date range starting at the prior start date and ending at the oldest end date.
|
| clone | () | method |
| contains | () | method |
public function contains(date:Date):BooleanReturn if the given date is contained in the current DateRange we just compare the date (and not the time)because this function helps to know if an item is contained in a calendar day cell
Parameters
date:Date |
Boolean |
| containsRange | () | method |
public function containsRange(range:DateRange):BooleanReturn if the given range is contained in the current DateRange.
Parameters
range:DateRange — range to check
|
Boolean — true if range is contained
|
| defineDayRange | () | method |
public function defineDayRange(date:Date):voidSet date range to the day of the given date
Parameters
date:Date — on which the range will be based
|
| defineMonthRange | () | method |
public function defineMonthRange(date:Date):voidSet date range to the month of the given date
Parameters
date:Date — on which the range will be based
|
| defineWeekRange | () | method |
public function defineWeekRange(date:Date):voidSet date range to the current week of the given date.
Parameters
date:Date — on which the range will be based
|
| defineYearRange | () | method |
public function defineYearRange(date:Date):voidSet date range to the year of given date.
Parameters
date:Date — on which the range will be based
|
| equals | () | method |
public function equals(dateRange:DateRange):BooleanCheck if date range equals the given date range by comparing startDate & endDate.
Parameters
dateRange:DateRange — to compare
|
Boolean — true if date ranges are the sames
|
| getConcurrencyIntersection | () | method |
public function getConcurrencyIntersection(dateRange:DateRange):DateRangeParameters
dateRange:DateRange |
DateRange |
| getDurationInDays | () | method |
public function getDurationInDays():intReturn the duration in days of the date range Important note: full day event are described with a end date set at day+1 but with 00:00 as hour/minutes
Returnsint |
| getDurationInHours | () | method |
public function getDurationInHours(splitToDayEnd:Boolean = false, splitToDayStart:Boolean = false):NumberReturn the duration between begin and end of the date range (in hours).
Parameters
splitToDayEnd:Boolean (default = false) — indicates if endDate day hours are counted
| |
splitToDayStart:Boolean (default = false) — indicates if only endDate day hours are counted
|
Number —
|
| getPertinentDate | () | method |
public function getPertinentDate():DateReturns a clone of:
Date —
|
| intersect | () | method |
public function intersect(range:DateRange):DateRangeReturns the data range representing the intersection between current range and given one.
Parameters
range:DateRange |
DateRange — a DateRange result of the intersection.
Note: valid property can be tested to know if there is some intersection. valid will return false if there is no intersection (start>end).
|
| mergeRanges | () | method |
public static function mergeRanges(ranges:ArrayCollection):ArrayCollectionMerge an array of ranges: ranges with intersections are merged leading to a new array of ranges.
Parameters
ranges:ArrayCollection — array of ranges (DateRange objects) to merge
|
ArrayCollection — merged array
|
| moveTo | () | method |
public function moveTo(newStart:Date):voidMove the current range to the new start date (move also the end date).
Parameters
newStart:Date |
| rangeMonthSpan | () | method |
public function rangeMonthSpan():intReturn the duration of the date range in months. This function helps to know how many renderer is necessary to draw the item in year view
Returnsint |
| rangeWeekSpan | () | method |
public function rangeWeekSpan():intReturn the duration of the date range in weeks. This function helps to know how many row is necessary to draw the item.
Returnsint |
| toString | () | method |
public function toString():StringReturns the string representation of the date range, i.e: 30/01/2010 18:45 -- 27/02/2010 00:10
ReturnsString — a string
|