on 09-19-2014 10:05 AM
Hi,
In our sap ui5 application we used third party date time picker plugin in one pop-up for insert update operations. Client told us to do not use the sap.m date time picker so we don't have any other choice that's why we have chosen one third party date time picker plugin .While inserting the date it was working fine but while retrieving the date time value from service to pop-up for update functionality the format has been changed completely.So i want to set the format for that date time picker i have tried the below code but does not worked fine will any one please give some suggestion....
var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "MM/d/y H:mm:ss A"});
var formattedStartDate = oDateFormat.format((startDate));
startDate.setValue(formattedStartDate);
Thanks in Advance for your help.
Regards
Selva
Hi Selva,
For setting the Date to the UI, make sure your entity is having the date field in Edm.DateTime type and your model is having date field in PT format, for eg. PT14H01M00S.
For more clarity, pls see this link
http://scn.sap.com/community/developer-center/front-end/blog/2013/04/28/working-with-odata-dates
Also let us know if you are getting any error in your browser console while setting the date to UI control.
Thanks
Naveenraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopal,
See the example below:
new sap.ui.commons.DatePicker("date",{
width: "10em",
value: {
path: "myModel>/dateValue",
//the format information
type: new sap.ui.model.type.Date({pattern: "DD/MM/YYY" , source :{pattern: "MM/d/y H:mm:ss A"}
Regards,
Ashvin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.