XPages - save date only in Date field

前端 未结 2 1260
死守一世寂寞
死守一世寂寞 2021-01-20 02:58

I\'m using an Edit Box control to display a date field. When the XPage is saved, I would like to save the date only (now both date and time are being saved). Is there any wa

2条回答
  •  攒了一身酷
    2021-01-20 03:24

    getDateOnly() returns a string. Try this:

    dt.setAnyTime();
    currentDocument.replaceItemValue("dateReparatur", dt);
    

    Or you may have to get the Document:

    currentDocument.getDocument(true).replaceItemValue("dateReparatur", dt);
    

提交回复
热议问题