Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Apr 01, 2010 @ 14:51
    trfletch
    0

    Change date picker format in Umbraco

    I have an Umbraco V4 website that is using the Datepicker datatype on a document type. The end user has requested that the way it be displayed within the Umbraco backend is changed. Currently it display as follows YYYY-MM-DD but they want it to be displayed in reverse more like how UK dates are usually displayed i.e. DD-MM-YYYY. It allows then to type the date in using this format but as soon as the page is saved it reverts to showing it as YYYY-MM-DD. Can this be changed and if so how easy is it to do?

  • dandrayne 1138 posts 2262 karma points
    Apr 01, 2010 @ 14:56
    dandrayne
    0

    Hi trfletch

    If you change the locale in the web.config to uk english the datepicker will use UK date formats.

    I think it's in the globalization section, as such:

    <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" uiCulture="en" culture="en-GB" />

    Dan

  • trfletch 598 posts 604 karma points
    Apr 01, 2010 @ 15:49
    trfletch
    0

    Hi Dan,

    Thanks for the response, I tried your suggestion but it doesn't appear to have made any difference. The datapicker field is still showing 2010-04-01 for todays date

  • dandrayne 1138 posts 2262 karma points
    Apr 01, 2010 @ 16:25
    dandrayne
    0

    poop.  Perhaps uiCulture must be en-GB too?

  • Robert J. Bullock 386 posts 405 karma points
    Apr 01, 2010 @ 17:28
    Robert J. Bullock
    0

    This is a massive problem for me too... How do I get the datepicker to display/store date as d/m/yyyy format?

  • trfletch 598 posts 604 karma points
    Apr 01, 2010 @ 18:36
    trfletch
    0

    Hi Dan,

    No luck I'm afraid, I now have  

    <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" uiCulture="en-GB" culture="en-GB" />   

    but it is still showing in the same "backwards" format.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Apr 01, 2010 @ 21:52
    Peter Dijksterhuis
    0

    You can't change it. It's hard-coded. Perhaphs create a new item on Codeplex to get it changed in future versions.

    I think this way of display is the best option though, there cannot be any confusion about the writing. If you see dd-mm-yyyy or mm-dd-yyyy it tends to confuse people and often result in wrong dates.

    If you really want it localised, you could create your own datatype that has the way of displaying you like.

    HTH,

    Peter

  • skiltz 501 posts 701 karma points
    Apr 01, 2010 @ 22:46
    skiltz
    0

    You could use this datetimepicker datatype.  http://our.umbraco.org/projects/skiltzdatetimepicker

  • trfletch 598 posts 604 karma points
    May 04, 2010 @ 14:15
    trfletch
    0

    Hi,

    Back to this issue again, I managed to resolve it for my date picker by using a custom datatype but I now have the same issue for the Published dates on the node which uses the same format. Is there any way of changing them so they are displayed DD/MM/YYYY?

  • trfletch 598 posts 604 karma points
    May 07, 2010 @ 14:44
    trfletch
    0

    Anyone know about this? Also is it possible to free type into the Publish dates fields or do you have to select something from the calendar?

  • Frost 70 posts 99 karma points
    Feb 23, 2012 @ 10:07
    Frost
    0

    Has anyone figured this out? I need to change the format for all dates displayed in the properties tab of each node ... the created, last published, and last edited dates, etc.

    We've spent a day and half on this to little avail and I just wrote a detailed post about it. Thanks in advance!
    http://our.umbraco.org/forum/using/ui-questions/29038-Change-Date-Format-in-Properties-Tab-(TinyMCE-bug)  

  • Connie DeCinko 931 posts 1160 karma points
    Dec 21, 2012 @ 19:54
    Connie DeCinko
    0

    Any update on this issue?

     

  • Eric Schrepel 161 posts 226 karma points
    Feb 16, 2013 @ 01:12
    Eric Schrepel
    0

    I'll also second that request. True, us Americans really should go metric and also input dates in yyyy-mm-dd format, but until we wise up, my users ask whether the standard DatePicker datatype could accept "m/d/yy" formatted dates by default, which I can't seem to get working.

    (Modifying the web.config key to read <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" uiCulture="en-US" culture="en-US" /> didn't change how the UI displays the DatePicker control.)

  • gary 385 posts 916 karma points
    Feb 17, 2013 @ 23:39
    gary
    1

    Hi

    I think I have a solution that works.

    @CurrentPage.StartDate.ToString("f") displays 

    Thursday, January 31, 2013 12:00 AM on date picker with time.

    Sure the answer you need is here somewhere, has most options for US and European formats.

    http://www.4guysfromrolla.com/articles/111010-1.aspx

    Hope this helps G

     

  • Wietze Strik 27 posts 131 karma points
    Apr 23, 2013 @ 11:14
    Wietze Strik
    0

    I'm having the same problem.

    I'm using the Umbraco DateTypes in the frontend of the website, but the datepicker won't format the date by the hostname culture. Also al the true/false datatypes display "Yes".

    I don't understand why these controls don't work properly, bacasue they are in it from the beginning and this issue is 3 years old!

  • Oscar Jurado 5 posts 25 karma points
    Nov 28, 2013 @ 20:33
    Oscar Jurado
    0

    I had the same issue, but I've discovered a solution...:

    1. Edit <root>\Umbraco_Client\Ui\jqueryui.js file, changing the line begining with "(function ($, undefined) { function Datepicker()" (in my case, line 65) exactly "this.regional[""] = { }" section. Here you can translate labels, month names, day names, and first day of week!
    2.  Edit <root>\Umbraco_Client\DateTimePickers\timepicker.js file, changing in "_generateHtml: function ()" the "html" variable (in my case, line 288), translating text for Hour and Minutes.
    3. Edit <root>\Config\ClientDependency.config file, increasing value of "<clientDependency version="x" ...".

    Then just refresh page in your browser and you can get your DatePicker customized ;-)

    It works for me in Umbraco v6.1.2 at backend.

    I hope this solution helps...

  • Sundance 12 posts 52 karma points
    Sep 05, 2014 @ 23:18
    Sundance
    0

    I do hate to bring up old threads, but I have an install of 7.1.6 and regardless of what I set the user to it does not change the date format of the date field. I've also set the globalization in my web.config set to <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" uiCulture="en-US" culture="en-US" /> still no changes. I also updated the datetimepicker view html and changed the data-format and it didn't work.

  • Sundance 12 posts 52 karma points
    Sep 05, 2014 @ 23:21
    Sundance
    0

    I have also manually set the bootstrap-datetimepicker.min.js format to not look for anything and hardcoded this.format = 'MM/dd/yyyy'; in. still nothing. 

  • Alain 73 posts 520 karma points c-trib
    May 20, 2015 @ 18:35
    Alain
    0

    I have submitted a PR in order to allow custom formats for datepicker. It Will be available in Umbraco 7.3.0. Hope that helps someone.

Please Sign in or register to post replies

Write your reply to:

Draft