on ‎2015 Aug 05 3:31 PM
Using a time picker with below code . The Server side of SAP is in EDM.string format as PT13H31M00S .
How is the value to be converted from time picker to required format.
<DateTimeInput
type="Time"
id="datepicker"
placeholder="Enter Time ..."
class="sapUiSmallMarginBottom" />
controller,js
var dtime = this.getView().byId('datepicker').getValue();
alert(dtime); //1:31 PM
Are there any functions to achieve the same ?
Request clarification before answering.
I have put my code here : JS Bin - Collaborative JavaScript Debugging . How can i achieve the conversion ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
// Controller definition
jQuery.sap.require("sap.ui.core.format.DateFormat");
sap.ui.controller("local.controller", {
timeFormatter : sap.ui.core.format.DateFormat.getDateInstance({
pattern : "PThh'H'mm'M'ss'S'"
}),
Get_time: function(oEvent) {
var dtime = this.getView().byId('datepicker').getDateValue();
debugger;
alert(this.timeFormatter.format(dtime)); //1:31 PM
//add seconds to the picker
//to be converted to PT13H31M00S
},
});
Maksim,
Is there something that i am missing to achieve via jsbin.?
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.