Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#2038 closed enhancement (fixed)

Split out display date and date value formats

Reported by: adcworks Owned by: grabanski
Priority: major Milestone: 1.5.1
Component: ui.datepicker Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Description

It would be so very useful to be able to display a different format to the format used as the actual value.

For example, in the UK we use the display format dd/mm/yy which is how i'd like users to see the date in the box when selected.

But we still use the MySQL date and datetime column data types as-is, and as such it would remove a conversion headache to receive yy-mm-dd from the date picker on a form submission.

Change History (7)

comment:1 Changed 9 years ago by paul

  • Owner set to iMarc

comment:2 Changed 8 years ago by anonymous

  • Milestone 1.2.2 deleted

Milestone 1.2.2 deleted

comment:3 Changed 8 years ago by paul

  • Component changed from ui.core to ui.datepicker
  • Version changed from 1.2.1 to 1.5b4

comment:4 Changed 8 years ago by paul

  • Owner changed from iMarc to grabanski
  • Status changed from new to assigned

comment:5 Changed 8 years ago by kbwood

You can convert the date formats easily yourself with code like the following during onsubmit:

$('.datepicker').each(function() {

var date = $.datepicker.parseDate('from/format', $(this).val()); $(this).val($.datepicker.formatDate('to/format', date));

});

comment:6 Changed 8 years ago by kbwood

  • Resolution set to fixed
  • Status changed from assigned to closed

Added altField and altFormat settings. altField is the jQuery selector for another input field to be populated with the date upon selection. altFormat is the alternative format to use for this field. You can then achieve the result of displaying the calendar in one format while submitting the selected date in a different format from a hidden field.

comment:7 Changed 8 years ago by rdworth

  • Milestone set to 1.5.1
  • Version changed from 1.5b4 to 1.5
Note: See TracTickets for help on using tickets.