XPage 仅限日期 fieldonly [英] XPages date only fieldonly
本文介绍了XPage 仅限日期 fieldonly的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在 XPage 中创建仅日期字段?我在 querySaveDocument 事件中尝试了以下操作,但该字段仍以 00:00:00 的时间部分结束
Is it possible to create a date only field in XPages? I have tried the following in the querySaveDocument event but the field still ends up with a time portion of 00:00:00
var notesDoc:NotesDocument = document1.getDocument();
var dt:NotesDateTime = session.createDateTime(@Today());
dt.setAnyTime();
notesDoc.replaceItemValue("MyDateField", dt);
推荐答案
这是 Sven 的代码:
Here is code by Sven:
ndt = session.createDateTime(ndt.getDateOnly());
item.setDateTimeValue(ndt);
更新:
我不得不做同样的事情,发现它在 8.5.2FP3 的 Java 代理中是这样工作的:
I had to do the same thing and found out that it's working this way in Java agent in 8.5.2FP3:
DateTime dt = session.createDateTime(new java.util.Date());
dt.setAnyTime();
doc.appendItemValue("DT", dt);
这篇关于XPage 仅限日期 fieldonly的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文