How to split StartDateTime field of Activity event object in Visual force page i tried to retrieve it with inputfield but i can find single box but not as the standard style of the field.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
To split a Datetime field into its constituents, you can use Datetime instance methods
You can also get the Hour, Minute and Seconds part of the time as separate strings.
To render a Datetime field in Visualforce, you need to bake your own field to display the date and time components separately, there isn't a native field type that you can use to display like it is on the Task Edit Screen. (i.e. a Time Picker like there is a Date Picker)
You can render this as field, one an inputField of type Date, which allows you to pick the date in a calendar.
For the time, render a selectList, with selectOptions to represent the time (08:00, 08:30,....)
Here is an example of how you could render a selectList for the time part.