On my User Sign up form, i need to allow user to select their "Birthdate". I have used "Date Picker" but it's showing the date in "yyyy-MM-dd" format (2014-09-03) something like that.
I need to change it to "dd/mm/yyyy" (03/09/2014). How to achieve this ?
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var tipsList = Model.Content.DescendantsOrSelf("ContainerTipsPopups").DescendantsOrSelf("FauxPopupPage").Where("Visible");
}
@foreach(var tip in tipsList){
@tip.GetPropertyValue("articleDate").ToString("mm-yyyy")
}
If I just use @tip.GetPropertyValue("articleDate") I get 2/24/2015 12:00:00 AM. If I try to format it with .ToString("mm-yyyy") I get:-
Compilation Error: No overload for method 'ToString' takes 1 arguments.
Is this the Umbraco Property Value Converters getting in the way again?
how to set the format of Date Picker
I am using Umbraco 7.1.6.
On my User Sign up form, i need to allow user to select their "Birthdate". I have used "Date Picker" but it's showing the date in "yyyy-MM-dd" format (2014-09-03) something like that.
I need to change it to "dd/mm/yyyy" (03/09/2014). How to achieve this ?
Can anyone please help me here ?
Thanks,
Rohan Dave
Hi Rohan,
Assuming Birthdate is the alias of your data picker property.
Jeavon
Doesn't work in the following for articleDate:-
If I just use @tip.GetPropertyValue("articleDate") I get 2/24/2015 12:00:00 AM. If I try to format it with .ToString("mm-yyyy") I get:-
Compilation Error: No overload for method 'ToString' takes 1 arguments.
Is this the Umbraco Property Value Converters getting in the way again?
Craig
is working on a reply...