Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rohan 105 posts 162 karma points
    Sep 03, 2014 @ 15:48
    Rohan
    0

    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

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Sep 03, 2014 @ 16:32
    Jeavon Leopold
    1

    Hi Rohan,

    @CurrentPage.Birthdate.ToString("yyyy-MM-dd")
    

    Assuming Birthdate is the alias of your data picker property.

    Jeavon

  • Craig100 1136 posts 2523 karma points c-trib
    Feb 24, 2015 @ 23:36
    Craig100
    0

    Doesn't work in the following for articleDate:-

    @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?

    Craig

     

  • Craig100 1136 posts 2523 karma points c-trib
    Feb 25, 2015 @ 00:06
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies