使用RichFaces的rich:calendar组件实现日期时间的选取

来源:互联网 发布:linux线程sleep 编辑:程序博客网 时间:2024/05/17 23:20

转自酷猫

 

<h:form>

<h:outputLabel value="选取时间" />

<h:panelGroup>

<rich:calendar id="selectTime" popup="true" locale="cn" value="#{myBean.selectTime}" cellWidth="30px" cellHeight="30px" datePattern="yyyy-MM-dd HH:mm" required="true" requiredMessage="必须填写开单时间" />

</h:message for="selectTime" style="color:red" >

</h:panelGroup>

</h:form>

最后在我们的messages_cn.properties文件添加以下key,value可以实现国际化

RICH_CALENDAR_TODAY_LABEL=今天
RICH_CALENDAR_CLOSE_LABEL=关闭
RICH_CALENDAR_OK_LABEL=确定
RICH_CALENDAR_CLEAN_LABEL=清空
RICH_CALENDAR_CANCEL_LABEL=取消

原创粉丝点击