cancel
Showing results for 
Search instead for 
Did you mean: 

Date Range Select cannot convert date format

lokijana
Participant
0 Kudos
192

Hi Experts,

I have date ranges, and want to convert the value into timestamp to insert the data to back-end.

here is my code for conversion.

var oFormatDate = sap.ui.core.format.DateFormat.getDateTimeInstance({
	pattern: "yyyy-MM-ddTKK:mm:ss"
});
var dateFromDeparture = sap.ui.getCore().byId("departureDateDR").getDateValue();
var dateToDeparture = sap.ui.getCore().byId("departureDateDR").getSecondDateValue();
console.log("fromDate", dateFromDeparture);
console.log("newFormat Date",  new Date(oFormatDate.format(dateFromDeparture)));<br>
<br>

it still shows the same format even I tried to format the date value;

View Entire Topic
gichuhimd
Explorer
0 Kudos

Hi,

How about you specify the format in your xml file like this:

<DateTimePicker id="departureDateDR"  valueFormat="yyyy-MM-dd'T'HH:mm:ss" />
Regards,Dominic.