-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Setup Device Preferences Missing YYYY-MM-DD Date Format #2933
Comments
i think technically that format isn't YMD, MYD or DMY the presence of weekday and the lack of a year complicates things think technically its "dddd mmm dd" firstly i personally prefer unambiguous date formats for English usage of written YMD doesn't seem to have a defined "long" format generally its just the [YYYY]-[MM]-[DD] format, but could also include a weekday but don't think there is any standard for that both "2021-07-09" or "2021 July 09" seem possibilities short, medium format respectively? the only country ive found so far that uses a consistent YMD full or long form is lithuania (lt_LT) e.g 2008 m. vasario 5 d., antradienis (full) secondly if reviewing dates in general there are other complications for other languages/countries e.g for Japanese, and i think china, there is only YMD format 2021年7月9日 , they are also usually spoken that way, also there is an optional weekday e.g 2021年7月9日金曜日 in Japanese there is no "july" only 7月 (しちがつ)(shichigatsu) literally 7th month so you basically have 2021/07/09 or 2021年7月9日 with the option for weekday personally i would replace if... else date code with a utility function that formats based upon language and selected date format e.g format_date(lang_code,endian,length,options) in the mycroft core if not obvious
and use a table of available formats see wikipedia for an example so could have something like
in the above "YYYYY" the extra Y signifies the year counter"年" im not familiar with what preexisting python modules exist for international date formatting a brief search found dateparser but don't know what else exists something like DateTime-Locale may be useful Time formatting may also show up at some point so might be wise to create a utility function for that as well both the 24 hour vs 12 hour clock English AM PM i believe Chinese is similar to Japanese but not identical 上午(AM) 下午(PM) and counters for hours,mins,seconds Chinese/Japanese 19時45分45秒 both Chinese and Japanese use the same characters, but they are read differently [19 Shí 45 fēn 45 miǎo][19-Ji 45-bu 45-byō] respectively if I'm remembering the readings right im not sure if/how this would tie in with Lingua Franca's datetime functionality, as wouldn't want unnecessary duplication I might be able to put some time into helping with this i if wanted, i can probably help with replacing if.. else with a utility function if that's decided as being the way to approach this. i probably need to think about/research this more |
Thanks @firebladed - so much useful detail there. I think the plan is for this to really live in Lingua Franca. As you say we don't want to duplicate and some of this already exists there, it just hasn't been intentionally exposed as a use case previously. I had a quick look but couldn't find if it was actively being worked on right now. @ChanceNCounter might be able to point us in the right direction? |
The lingua_franca.config branch that's semi-active will expose things like the date formats on offer, but it relies on whatever's importing it to set config values at runtime. In this case, that's presumably still For languages where they're implemented, available date and DT formats are currently represented as regex in Adding different DT formats should be as "easy" (straightforward) as adding elements in there. The toughest part would be coming up with the regex. I'd also like to spin those off into common files for a particular language (at least) but that's another thing entirely. As for exposing it, that'd be MycroftAI/lingua-franca#185 (and corresponding issue 128) |
Closing Issue since we're archiving the repo |
Is your feature request related to a problem? Please describe.
Missing YYYY-MM-DD Date Format on https://account.mycroft.ai/devices/add
Describe the solution you'd like
add YYYY-MM-DD Date Format option
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
variants of YMD used internationally and is part of ISO 8601 standard (https://www.iso.org/standard/70907.html)
The text was updated successfully, but these errors were encountered: