Skip to main content
13 events
when toggle format what by license comment
Aug 6, 2015 at 4:45 comment added JJSHHS @crop1645 - Do you have any suggestions on it? If this is the right way or is there an alternate correct way of doing it?
Aug 4, 2015 at 21:31 answer added Aayush K timeline score: 1
Aug 4, 2015 at 20:11 comment added JJSHHS @AAU - I've pasted the code above. Please take a look and advise.
Aug 4, 2015 at 20:05 history edited JJSHHS CC BY-SA 3.0
added 3342 characters in body
Aug 4, 2015 at 10:42 answer added Vivek Malpani timeline score: 0
Aug 3, 2015 at 19:34 comment added Aayush K Can you post your code? adding type="date" to your <apex:input> should take care of the format.
Aug 3, 2015 at 19:28 comment added cropredy You really should be using apex:inputField bound to an sobject field of type date; the VF page will only allow entry of valid date formats. Your apex controller code can be used to test for ranges. You can use 'proxy' sobjects in your controller if the user-entered date isn't intended to be saved as part of some DML operation.
Aug 3, 2015 at 19:26 comment added JJSHHS I even tried hardcoding the date as '07/31/2015' just to see what would happen, but it always convert into Jul 31 2015 00:00:00 this format.
Aug 3, 2015 at 19:22 comment added JJSHHS @AAU - I'm getting the above problem when I use apex:inputfield tag. Hence, I had to use apex:input as an alternative but I'm asking in this forum if someone has run into this issue and if so, is there an acceptable workaround
Aug 3, 2015 at 19:20 comment added JJSHHS @Prabhat - Right, that's what I tried in my controller code, string date1 = contact.Birthdate.format(); contact.Birthdate = date.parse(date1); return page.datePickerJS; but it's still not working.
Aug 3, 2015 at 19:20 comment added Aayush K any reason why you are not using <apex:inputField> tag?
Aug 3, 2015 at 19:18 comment added MIX DML Give a try to your date format something like this - MM/dd/yyyy
Aug 3, 2015 at 19:04 history asked JJSHHS CC BY-SA 3.0