Opened 8 years ago

Closed 6 years ago

#17544 closed enhancement (patchwelcome)

dojo/date/locale: add support a "none" formatLength

Reported by: vapier Owned by:
Priority: undecided Milestone: 1.13
Component: Date Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:


the current dojo/date/locale formatLength logic makes it nigh impossible to implement standard international formats (like the venerable RFC2822). you have to hack around it by doing something like:

function format(date, datePattern, timePattern) {
  // Assumes the patterns don't themselves use { or }.
  return locale.format(date, {
    formatLength: 'short',
    datePattern: datePattern + '{',
    timePattern: '}' + timePattern
  }).replace(/{.*}/, ' ');

if we could set formatLength to "none" and the cldr logic would simply concat them together with a space, that'd be perfect.

        "dateTimeFormat-none": "{1} {0}",

Change History (2)

comment:1 Changed 8 years ago by Adam Peller

the contents of the cldr files are generated from LDML. There is no 'none' variant at this time.

Also, RFC822 is not locale sensitive, so it's probably best to construct that format using a separate codepath.

comment:2 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 2+ years, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!

Note: See TracTickets for help on using tickets.