b3by / atom-clock

Place a clock or calendar in your status bar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README should mention how to make it follow the system short and long time formats

lee-dohm opened this issue · comments

With system short and long time formats, do you mean something like this?

Short -> 1/1/1970, 4:20 pm
Long -> Fri, November 1st 1970, 4:20 pm

I was thinking about extending the README a little bit, still I'm not sure about what system format means.

Sorry I wasn't able to get back to you on this. I got hit by the blackout yesterday and had no power or Internet for 20+ hours. On OS X (and Windows) there is a section in the OS-level preferences that allows you to set the standard date and time settings for your region. There are generally short and long date and time formats. Here's what the screen looks like in OS X:

screen shot 2015-11-18 at 2 47 46 pm

It would be great if I could just say something like os-short and it would read the format from the OS and use that.

It looks like LT and LTS come close in that they are localized based on the detected region.

You're right, Moment supports a long format with localization support too.
One possible solution could be provide some default formats, and give the user the chance to use one of those. This would mean:

  • A boolean flag in the configuration for 'Use default format'
  • A small map with some default formats translated into Moment formats.
defaultFormats:
  os-short: 'LT'
  os-medium: 'LTS'
  os-long: 'LTS z'
  ...

Still, should take a closer look to some other systems, and see if there are particular formats that make this worth it.