Class JSCalender.PopCalender
Represents a PopCalender.
Defined in: calendar.js.
Constructor Attributes | Constructor Name and Description |
---|---|
JSCalender.PopCalender(targetId, onClickElementId)
Construct a new PopCalender.
|
Field Attributes | Field Name and Description |
---|---|
The id of calender's container
|
|
The config of calender
|
|
The first day in week
|
|
This month
|
|
The days' number in month
|
|
The id of the element which be clicked to show calender
|
|
The resource of calender
|
|
The id of input element where calender outputs
|
|
Today
|
|
This year
|
Method Attributes | Method Name and Description |
---|---|
<private> |
Add event to calendar.
|
<private> |
_addClass(el, className)
Add css class to element.
|
<private> |
Add event to window.document.
|
<private> |
Add event to month combobox
|
<private> |
Add event to year combobox
|
<private> |
_checkSlidePanel(date)
Check data to decide that whether show the slide panel
|
<private> |
_clickCheck(event)
Hide calendar or combobox when clicked
|
<private> |
Create calendar's body panel.
|
<private> |
Create calendar's bottom panel.
|
<private> |
Create calendar's container.
|
<private> |
Create calendar's dates in body panel.
|
<private> |
Create calendar's days in body panel.
|
<private> |
Create calendar's panel.
|
<private> |
Create calendar's slide panel.
|
<private> |
Create calendar's top panel.
|
<private> |
Create a iframe to fix the combobox's bug of IE6.
|
<private> |
Create month combobox.
|
<private> |
_createYearCombobox(year)
Create year combobox.
|
<private> |
Fresh calendar
|
<private> |
_getDateString(year, month, date)
Convert Date to string
|
<private> |
_getMonthDate(month)
Get the number of dates by month.
|
<private> |
_getPosition(el)
Get left and top of element
|
<private> |
_getYearWeek(date)
Get the index of year's week by date.
|
<private> |
_hide()
Hide calendar
|
<private> |
Initialize calendar.
|
<private> |
_keyEvent(event)
Process key event when press keyboard
|
<private> |
Get next month's calendar
|
<private> |
Get next year's calendar
|
<private> |
_parseDate(step)
Fresh calendar when press keyboard
|
<private> |
Get last month's calendar
|
<private> |
_preYear()
Get last year's calendar
|
<private> |
_print(dateString)
Output the selected date
|
<private> |
_remove()
Remove calendar
|
<private> |
_removeClass(el, className)
Remove css class of element.
|
<private> |
Remove evnent of window.document
|
<private> |
_show()
Show calendar
|
<private> |
_showSlidePanel(img, text, dateString)
Show slide panel
|
setConfig(config)
Set the config of calendar
|
|
setCss(css)
Set the css of calendar
|
|
setFirstDayInWeek(day)
Set the first day in week
|
|
setLanguage(lang)
Set the language of calendar
|
|
setPrintFarmat(printFormat)
Set the export format
|
|
setSlideDate(date, image, text)
Set the export format
|
|
show()
Show the calendar.
|
Class Detail
JSCalender.PopCalender(targetId, onClickElementId)
Construct a new PopCalender.
var myCalender = new JSCalender.PopCalender("inputId", "buttonId");
- Parameters:
- {String} targetId
- The id of the Calender's input element.
- {String} onClickElementId
- The id of the Calender's input element.
- Returns:
- A new instance of a Calender.
Field Detail
{String}
calendarContainerId
The id of calender's container
- Default Value:
- "fogtower-calendar-calendarcontainer"
{Object}
config
The config of calender
{Number}
firstDayInWeek
The first day in week
this.firstDayInWeek = 0; The first day in week is Monday. this.firstDayInWeek = 6; The first day in week is Sunday.
{Number}
month
This month
{Array}
monthDate
The days' number in month
{String}
onClickElementId
The id of the element which be clicked to show calender
{Object}
resource
The resource of calender
{String}
targetId
The id of input element where calender outputs
{Date}
thisDay
Today
{Number}
year
This year
Method Detail
<private>
_addCalendarEvent()
Add event to calendar.
<private>
_addClass(el, className)
Add css class to element.
- Parameters:
- {Object} el
- The element where adds class.
- {String} className
- The css class which to be added..
<private>
_addDocumentEvent()
Add event to window.document.
<private>
_addMonthComboboxEvent()
Add event to month combobox
<private>
_addYearComboboxEvent()
Add event to year combobox
<private>
_checkSlidePanel(date)
Check data to decide that whether show the slide panel
- Parameters:
- {String} date
- The date.
<private>
_clickCheck(event)
Hide calendar or combobox when clicked
- Parameters:
- event
<private>
{String}
_createCalendarBody()
Create calendar's body panel.
- Returns:
- {String} Create body panel of calendar.
<private>
{String}
_createCalendarBottom()
Create calendar's bottom panel.
- Returns:
- {String} Create bottom panel of calendar.
<private>
_createCalendarContainer()
Create calendar's container.
<private>
{String}
_createCalendarDates()
Create calendar's dates in body panel.
- Returns:
- {String} Create dates in body panel of calendar.
<private>
{String}
_createCalendarDays()
Create calendar's days in body panel.
- Returns:
- {String} Create days in body panel of calendar.
<private>
{String}
_createCalendarPanel()
Create calendar's panel.
- Returns:
- {String} Create panel of calendar.
<private>
{String}
_createCalendarSlide()
Create calendar's slide panel.
- Returns:
- {String} Create slide panel of calendar.
<private>
{String}
_createCalendarTop()
Create calendar's top panel.
- Returns:
- {String} Create top panel of calendar.
<private>
{Object}
_createIframeShim()
Create a iframe to fix the combobox's bug of IE6.
- Returns:
- {Object} The created iframe.
<private>
{String}
_createMonthCombobox()
Create month combobox.
- Returns:
- {String} Create month combobox of calendar.
<private>
{String}
_createYearCombobox(year)
Create year combobox.
- Parameters:
- year
- Returns:
- {String} Create year combobox of calendar.
<private>
_freshDaysPanel()
Fresh calendar
<private>
_getDateString(year, month, date)
Convert Date to string
- Parameters:
- {Number} year
- The year.
- {Number} month
- The month.
- {Date} date
- The date.
<private>
_getMonthDate(month)
Get the number of dates by month.
- Parameters:
- {Number} month
- The month.
- Returns:
- The number of dates.
<private>
_getPosition(el)
Get left and top of element
- Parameters:
- {Object} el
- The element which will be get left and top.
<private>
_getYearWeek(date)
Get the index of year's week by date.
- Parameters:
- {Date} date
- The date.
- Returns:
- The index of week.
<private>
_hide()
Hide calendar
<private>
_initialize()
Initialize calendar.
<private>
_keyEvent(event)
Process key event when press keyboard
- Parameters:
- {Object} event
- The event which comes from pressing keyboard.
<private>
_nextMonth()
Get next month's calendar
<private>
_nextYear()
Get next year's calendar
<private>
_parseDate(step)
Fresh calendar when press keyboard
- Parameters:
- {Number} step
- The diff which compares with the selected date.
<private>
_preMonth()
Get last month's calendar
<private>
_preYear()
Get last year's calendar
<private>
_print(dateString)
Output the selected date
- Parameters:
- {String} dateString
- The format of outputed date
<private>
_remove()
Remove calendar
<private>
_removeClass(el, className)
Remove css class of element.
- Parameters:
- {Object} el
- The element where removes class.
- {String} className
- The css class which to be removed..
<private>
_removeEvent()
Remove evnent of window.document
<private>
_show()
Show calendar
<private>
_showSlidePanel(img, text, dateString)
Show slide panel
- Parameters:
- img
- text
- dateString
setConfig(config)
Set the config of calendar
- Parameters:
- {String} config
- The config which to be set
setCss(css)
Set the css of calendar
- Parameters:
- {String} css
- The css which to be set
setFirstDayInWeek(day)
Set the first day in week
- Parameters:
- {Number} day
- The day which to be set
setLanguage(lang)
Set the language of calendar
- Parameters:
- {String} lang
- The language which to be set
setPrintFarmat(printFormat)
Set the export format
- Parameters:
- {String} printFormat
- The print format which to be set
setSlideDate(date, image, text)
Set the export format
- Parameters:
- {String} date
- The date which to be set
- {String} image
- The image which to be show in slide panel
- {String} text
- The text which to be show in slide panel
show()
Show the calendar.