Calendar

FineUI. Calendar

new Calendar(options)

Description:
Examples
日期格式规则请参考:FineUI.parseDate

创建独立日历控件(区别于FineUI.DatePicker,不依赖输入框,直接展开显示):

FineUI.create({
	type: 'Calendar', renderTo: document.body, value: new Date()
});

使用showTime: true同时显示时间选择面板:

FineUI.create({
	type: 'Calendar', renderTo: document.body, showTime: true, format: 'yyyy-MM-dd HH:mm:ss'
});

使用displayType: 'dayrange'选择日期范围,showConfirmButton: true需点击确定才触发select事件:

FineUI.create({
	type: 'Calendar', renderTo: document.body, displayType: 'dayrange', showConfirmButton: true,
	listeners: {
		select: function (event) {
			FineUI.alert('选中范围:' + this.getValue());
		}
	}
});
Parameters:
Name Type Description
options Object

初始参数

Properties
Name Type Default Description
format string 'yyyy-MM-dd'

日期格式字符串

minValue string ''

最小值

maxValue string ''

最大值

displayType string 'day'

显示类型(可选项为:day, year, month, time, dayrange, yearrange, monthrange, timerange)

rangeSeparator string '

' - 日期范围的分隔符

showTime boolean false

是否显示时间

showMinute boolean true

是否显示分钟

showSecond boolean true

是否显示秒钟

stackDateTime boolean false

层叠显示日期面板和时间面板(默认为false,仅当displayType=day和showTime=true时有效)

showTodayButton boolean true

是否显示今天按钮(默认为true,仅当displayType=day时有效)

showConfirmButton boolean false

点击确定按钮才会触发选择事件

type string 'Calendar'

控件类型

Extends

Members

el :jQuery

Description:
  • 控件对应的jQuery节点对象

Inherited From:

控件对应的jQuery节点对象

Type:
  • jQuery

Methods

getEncodedText(text) → {string}

Description:
  • 获取编码后的字符串

Inherited From:
Parameters:
Name Type Description
text string

原始字符串

Returns:

编码后的字符串

Type
string

isType(value) → {boolean}

Description:
  • 检测当前实例是否指定的控件类型

Inherited From:
Example
grid1.isType('panel') // 返回true
grid1.isType('grid')  // 返回true
Parameters:
Name Type Description
value Object

控件类型

Returns:

如果当前实例是指定的控件类型,返回true;否则返回false

Type
boolean

Events

beforehide

Description:
  • 隐藏控件之前触发(返回false则取消隐藏操作)

Inherited From:

beforeshow

Description:
  • 显示控件之前触发(返回false则取消显示操作)

Inherited From:

hide

Description:
  • 隐藏控件时触发

Inherited From:

layout

Description:
  • 布局控件时触发

Inherited From:

remove

Description:
  • 移除控件时触发(调用 remove() 时,控件 DOM 被销毁之前触发;可用于清理外部资源 / 解绑全局事件)

Inherited From:

render

Description:
  • 渲染控件时触发

Inherited From:

select

Description:
  • 选中日期时触发

Parameters:
Name Type Description
event jQuery.Event

事件对象

show

Description:
  • 显示控件时触发

Inherited From: