You need to sign in to do that
Don't have an account?
Date format changing while page is refreshing
Hi Guys,
I have date field in Vf Like : <apex:inputtext id="implatedDate" size="10" value="{!tissue.implanteddate}"/>
and this "implanteddate" from Wrapper class. Also i have one command button "Next"
By clicking on Next button my page is refreshing and by that time date format is changing it to different format and showing the below error:
" Value 'Wed Dec 16 00:00:00 GMT 2015' cannot be converted from Text to com.force.swag.soap.DateOnlyWrapper "
Please update me with your solution.
I have date field in Vf Like : <apex:inputtext id="implatedDate" size="10" value="{!tissue.implanteddate}"/>
and this "implanteddate" from Wrapper class. Also i have one command button "Next"
By clicking on Next button my page is refreshing and by that time date format is changing it to different format and showing the below error:
" Value 'Wed Dec 16 00:00:00 GMT 2015' cannot be converted from Text to com.force.swag.soap.DateOnlyWrapper "
Please update me with your solution.
Public Date implanteddate;
Public void setimplanteddate(String implanteddate) {
this.implanteddate= date.parse(implanteddate);
}
public String getimplanteddate() {
return (implanteddate== null) ? null : implanteddate.format();
}
Public Date implanteddate {get; set;}
if i use like this..when my VF page refresh on that time my date format is going to change...
atr there i am using date picker..
please give me some suggestions..
Public string implanteddate {get; set;}
private date myDate;
In your constructor you can format the date you want to populate in the visualforce page input control.
For example : implanteddate = Date.today().format();
And in any of your methods you want it as date then convert it back again to Date as below.
myDate = Date.valueOf(implantedDate);
Hope this helps.
Kind Regards,
Krishna.