Open fioricddev opened 8 years ago
cus.crm.opportunity.util.Formatter.dateFormatter(new Date())
in step 2 doesn't match with Dateformat
of DatePicker
. In result, DatePicker
can not parse the input string date value. Such as: Jan 19, 2016
.
Use DatePicker
format method to format new Date()
in step 2:
var oDatePickerStartDate = this.byId('datePickerStartDate'),
sTodayDateValue = oDatePickerStartDate._formatValue(new Date());
oDatePickerStartDate .setValue(sTodayDateValue); // sTodayDateValue: 19.01.2016
<DatePicker id="datePickerStartDate" displayFormat="medium" valueFormat="medium" ></DatePicker>
this.byId('datePickerStartDate').setValue(cus.crm.opportunity.util.Formatter.dateFormatter(new Date()));
su01
in ASAP setting to choose ignore option item// Configuration.js
var M_ABAP_DATE_FORMAT_PATTERN = {
"" : {pattern: null},
"1": {pattern: "dd.MM.yyyy"},
"2": {pattern: "MM/dd/yyyy"},
"3": {pattern: "MM-dd-yyyy"},
"4": {pattern: "yyyy.MM.dd"},
"5": {pattern: "yyyy/MM/dd"},
"6": {pattern: "yyyy-MM-dd"},
"7": {pattern: "Gyy.MM.dd", ignore:true},
"8": {pattern: "Gyy/MM/dd", ignore:true},
"9": {pattern: "Gyy-MM-dd", ignore:true},
"A": {pattern: "yyyy/MM/dd"},
"B": {pattern: "yyyy/MM/dd"},
"C": {pattern: "yyyy/MM/dd", ignore:true}
};
So you could choose 7
, 8
, 9
or C
. Then input format cus.crm.opportunity.util.Formatter
and DatePicker
will use the default format pattern from locale json file to parse value. Such as: en.json
with 'short' pattern:
dateFormat-long: "MMMM d, y"
dateFormat-medium: "MMM d, y"
dateFormat-short: "M/d/yy"
Otherwise, DatePicker
will use the pattern from ABAP setting. Such as:
"1": {pattern: "dd.MM.yyyy"}
In this way, DatePicker
default pattern value is: dd.MM.yyyy
, but input value format in step 2 will use the different one in locale json file: "M/d/yy
. In result, DatePicker
can not parse input date value.
Description
When render is completed, no value display on date picker.