changing the datepicker date format

changing the datepicker date format

craycray Posts: 10Questions: 0Answers: 0
edited October 2012 in Editor
I got everything working just great using a few different tables except the datepicker in the data entry screen. This is not a sorting problem but I did look those many of those discussions. I'm using mysql database, I have the dates as Y-m-d (example 2010-10-15). The date pick has defaulted to d-m-y. So it doesn't give the right date. I tried changing the default using the following and a few others I found but it doesn't have any effect. I also searched throughout the code to find where it might be initialized but didn't see anything. It's probably simple but simple things are hard to find.


$('#formatdate').change(function(){
$('#datpicker').datepicker("option","dateFormat","yy-mm-dd");
});

Replies

  • craycray Posts: 10Questions: 0Answers: 0
    Adding to the above: I found the datepicker formating step in the file dataTables.editor.min.js and changed the following

    if(!a.dateFormat)a.dateFormat=e.datepicker.RFC_2822;
    to
    if(!a.dateFormat)a.dateFormat=e.datepicker.RFC_8601;
    nothing changed so I changed it to
    a.dateFormat=e.datepicker.RFC_8601;
    and still no format change??
  • craycray Posts: 10Questions: 0Answers: 0
    Found the setting, knew it had to be simple bu just never so it.
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Hi cray,

    Good to hear you found the parameter. It is noted in the `date` field type documentation here http://editor.datatables.net/fields/#date .

    Regards,
    Allan
  • nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
    Do you also offer support for a Twitter Bootstrap compatible datepicker, such as:
    https://github.com/eternicode/bootstrap-datepicker

    How would I integrate this?
    /Nate
This discussion has been closed.