• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Remove redundant AM/PM when formatting a time range?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remove redundant AM/PM when formatting a time range?


  • Subject: Re: Remove redundant AM/PM when formatting a time range?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 11 Apr 2014 09:12:05 -0700

On Apr 11, 2014, at 8:41 AM, Ben Kazez <email@hidden> wrote:

> I’m trying to create a compact time range format, like “2am-4pm” or “2-5:30pm”. I am constructing the format string using -dateFormatFromTemplate:options:locale:, omitting the minutes from the template if that component is zero. Is there an internationalization-safe way that I can remove the AM/PM from one of the times if it is redundant? What about the space, if a locale considers that space optional?

Can you do this by making the format strings themselves localizable? For instance you might have special format string IDs for use when both times are AM or both PM, one for the first time and one for the second. The localizer can then decide which of those two format strings should drop the AM/PM indicator.

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Remove redundant AM/PM when formatting a time range?
      • From: Ben Kazez <email@hidden>
References: 
 >Remove redundant AM/PM when formatting a time range? (From: Ben Kazez <email@hidden>)

  • Prev by Date: Remove redundant AM/PM when formatting a time range?
  • Next by Date: Re: iOS: Cannot connect to iTunes Store
  • Previous by thread: Remove redundant AM/PM when formatting a time range?
  • Next by thread: Re: Remove redundant AM/PM when formatting a time range?
  • Index(es):
    • Date
    • Thread