Ticket #2038 (closed enhancement: fixed)

Opened 7 years ago

Last modified 5 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 7 years ago by paul

  • Owner set to iMarc

comment:2 Changed 6 years ago by anonymous

  • Milestone 1.2.2 deleted

Milestone 1.2.2 deleted

comment:3 Changed 6 years ago by paul

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

comment:4 Changed 6 years ago by paul

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

comment:5 Changed 6 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 6 years ago by kbwood

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

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 6 years ago by rdworth

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