简体   繁体   English

Flex DateChooser:如何覆盖'今天'日期?

[英]Flex DateChooser: how to override the 'today' date?

By default, the Flex DateChooser highlights the 'today' date. 默认情况下,Flex DateChooser会突出显示“今天”日期。 I assume it gets this date from the OS. 我假设它从操作系统获得此日期。 Is there a way to tell DateChooser what the 'today' date should be? 有没有办法告诉DateChooser“今天”的日期应该是什么?

By looking at the source code of mx.controls.CalendarLayout (which is used internally by DateChooser ): 通过查看mx.controls.CalendarLayout的源代码(由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. 您可以扩展/替换DateChooserCalendarLayout类,并覆盖相关的函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM