tags:

views:

831

answers:

2

By default, the Flex DateChooser highlights the 'today' date. I assume it gets this date from the OS. Is there a way to tell DateChooser what the 'today' date should be?

+2  A: 

By looking at the source code of mx.controls.CalendarLayout (which is used internally by DateChooser):

// Determine whether this month contains today.
var today:Date = new Date();
var currentMonthContainsToday:Boolean = (today.getFullYear() == newYear && today.getMonth() == newMonth);

it seems that you have no influence on this. You could, of couse, extend/replace the DateChooser and CalendarLayout classes, and override the relevant functions.

David Hanak
Thanks for pointing me in the right direction. Cheers
Mike Sickler
+1 think extending the CalendarLayout class would be a tough job though. CalenderLayout is enormous and it's probably very easy to break
James Hay
@James: agreed. Still, I guess this is the only option if one really wants to change "today".
David Hanak
A: 

I am looking for something similar, cannot find anything yet.

Mike, wondering if you found a good way of implementing this, other than writing custom DateChooser and CalendarLayout components.

Tejas