xPages date field in Domino 9 default value is today's date!

Hi All,

I’m testen xPage applications in Notes 9 (Domino) and did find a big bug !

A date field (Date time picker) on a new document defaults to the current date !

Tried to put a space in the default value but that is also changed to the current date.

The Dojo Form Date text box leaves it blank.

Anybody experiencing the same problem?

regards,

Peter

Subject: Known issue, workaround available…

Workaround from another forum where the same issue has been reported:
Subject Update
Company name: IBM

The following SPR has been logged against this issue.

SPR# Description
DEGN966F5V Xpages Date Time Picker field defaults to today’s date

In the meantime, a workaround is provided in the SPR and herein.

Updated workaround:
Workaround is to clobber the widget prototype postCreate function to prevents the value being reset like so.

require([
“dojo/_base/lang”,
“ibm/xsp/widget/layout/DateTextBox”,
“ibm/xsp/widget/layout/TimeTextBox”,
“ibm/xsp/widget/layout/DateTimeTextBox”
], function(lang, DateTextBox, TimeTextBox, DateTimeTextBox){
var a = {};
lang.mixin(a, {
postCreate: function(){
this.inherited(arguments);
}
});
DateTextBox.extend(a);
TimeTextBox.extend(a);
DateTimeTextBox.extend(a);
});

Original workaround as posted:
Workaround is to extend the widgets prototype with a startup function which resets value like so.

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core http://www.ibm.com/xsp/core”>
xp:this.resources
<xp:script clientSide=“true”>
xp:this.contents</xp:this.contents>
</xp:script>
</xp:this.resources>

<xp:inputText id=“inputText1” value=“#{sessionScope.inputText1}”>
xp:this.converter
<xp:convertDateTime type=“date” />
</xp:this.converter>
<xp:dateTimeHelper />
</xp:inputText>
</xp:view>