简体   繁体   English

YUI 2.0日历-如何获取当前日历页面

[英]YUI 2.0 calendar - how to get current calendar page

I'm looking for a way to get the current pagedate. 我正在寻找一种获取当前pagedate的方法。 I know how to get the original config or even how to subscribe to changePageEvent and get it while scrolling, but neither covers a case when someone opens the calendar scrolls through few months and then closes and re-opens, I need the pagedate for that page. 我知道如何获取原始配置,甚至不知道如何订阅changePageEvent并在滚动时获取它,但是都没有涉及到有人打开日历滚动数月然后关闭然后重新打开的情况,我需要该页面的pagedate 。 There has to be a property that records that, but can't find in the API. 必须有一个记录该属性的属性,但是无法在API中找到。

Here is an example of a popup calendar that remains on the last calendar page viewed, even if a date isn't selected. 这是一个弹出式日历的示例,即使未选择日期,该弹出式日历仍保留在上次查看的日历页面上。 Browse to a month and close the calendar using the "x" in the corner. 浏览到一个月,然后使用角落的“ x”关闭日历。 When you click the button to display the calendar again you'll find it's on the same page you last navigated to: 当您单击该按钮再次显示日历时,您会发现它在上次导航到的同一页面上:

Calendar Control: Popup Calendar - Basic 日历控件:弹出式日历-基本

I don't see any code in the example source code that sets the date, so in the absence of your source code I'll have to guess that you're instantiating a new calendar each time you show it. 我在示例源代码中看不到用于设置日期的任何代码,因此在没有源代码的情况下,我不得不猜测每次显示时都要实例化一个新日历。

To get the month/year displayed use the pagedate property . 要获取显示的月份/年份,请使用pagedate属性

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

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