on 01-17-2014 6:29 AM
Hi,
I have a requirement to get the number of hours worked.So is it possible to get only the hours and minute avoiding the AM/PM in the DateTimeInput ?
If so how to do it.Please suggest me if any alternatives is there.
Regards,
Jeffin
The below code may be what you want, I cannot take the credit here as it comes from the test page for the DateTimeInput Object
dti1 = new sap.m.DateTimeInput({
placeholder : "Time Picker",
type : "Time",
valueFormat : "HH:mm",
value : "11:23",
displayFormat : "H'h' m'm'",
change : function(e) {
page.setTitle(e.getParameters().newValue);
}
See the below link and look at the Duration Field
If you not downloaded the SDK it worth doing so as there loads of test pages there.
All under the folder test-resources\sap\m
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeffin,
Could you post your code¿? This page has a lot of examples. You could set hour:minute and its value is binded to a TextView:
Kind regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for the reply.I am new to UI5 development,doesn't know much about it.Actually i want to get the hours and minutes from the user.Using sap.m.DateTimeInput i am able to get the time but i doesn't want to display the AM/PM field in the popup.I want only hours and minutes to be displayed.
<script type='text/javascript'>
var app = new sap.m.App("myapp", {
initialPage : "page1"
});
var txt = new sap.m.DateTimeInput("time",{type : sap.m.DateTimeInputType.Time});
var lab = new sap.m.Label({text: "Working Time"});
var line = new sap.m.HBox({
items : [lab, txt]
});
var page1 = new sap.m.Page("page1", {
title : "Login",
backgroundDesign : sap.m.PageBackgroundDesign.Transparent,
content : [line],
});
app.addPage(page1);
app.placeAt("page");
</script>
Thanks
Jeffin
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.