ChristopherRogers1991 / mycroft_routine_skill

Create, run, and schedule routines with Mycroft
GNU General Public License v3.0
30 stars 13 forks source link

Feature request: support 24-hour time to accommodate European defaults #5

Open KathyReid opened 5 years ago

KathyReid commented 5 years ago

This feedback came through a person who was doing a lot of translation on the Mycroft Translate platform in the Dutch language

Is it possible to support utterances in 24-hr time, such as "nineteen hundred hours" for 7pm - as this style of phrase is very common in European languages.

ChristopherRogers1991 commented 5 years ago

Hey @KathyReid,

Thanks for sending this in. I think this would be as simple as adding or hour >= 12 to this line. I'll keep this in mind and see if I can knock it out when I've got a spare moment (hopefully sometime next week).

-Chris

penrods commented 5 years ago

Try out the extract_datetime() method. I think it might solve this for you. It handles things like "Thursday at oh-5-hundred", etc.

https://github.com/MycroftAI/mycroft-core/blob/dev/test/unittests/util/test_parse.py#L343