Primefaces日历选择器不能与MMM模式一起使用 [英] Primefaces calendar picker doesn't work with MMM pattern

查看:228
本文介绍了Primefaces日历选择器不能与MMM模式一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从首页使用日历组件,如下所示: PrimeFaces - ShowCase:Calendar - Time

I'd like to use a Calendar component from the primefaces as shown here: PrimeFaces - ShowCase : Calendar - Time

<p:calendar id="startDateSelected" value="#{myBB.dateSelected}" 
pattern="dd/MMM/yyyy">

dateSelected $ c> Date()

dateSelected is just a plain Date()

它适用于在展示中提到的模式,但我想使用以下模式:

It works fine for the patterns mentioned in the showcase, but I'd like to use the following pattern:

dd-MMM-yyyy HH:mm

当我使用这个,与选择器的对话框不显示。当我从模式中删除时间时,选择器工作(仅适用于日期),如果我将 MMM 更改为 MM ,它也工作。

When I use this, the dialog with picker doesn't show up. When I remove the time from the pattern, the picker works(only for date obviously) and if I change MMM to MM, it also works.


  • dd-MMM-yyyy 工程

  • dd-MM-yyyy HH:mm 工程

  • dd-MMM-yyyy HH: / code>不起作用

  • dd-MMM-yyyy works
  • dd-MM-yyyy HH:mm works
  • dd-MMM-yyyy HH:mm doesn't work

所以唯一的问题是MMM和时间的结合。
任何想法?

So the only problem is a combination of MMM and time. Any ideas?

推荐答案

我在我身边使用了以下模式。

I have used following pattern at my side.

<p:calendar value="#{calendarBean.date3}" pattern="EEE, dd/MMM/yyyy HH:mm" />



EEE,dd MM,yyyy



EEE, dd MM, yyyy

<p:calendar value="#{calendarBean.date2}" pattern="EEE, dd MM, yyyy HH:mm" />

这边是罚款。

>

这篇关于Primefaces日历选择器不能与MMM模式一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆