parsedatetime icon indicating copy to clipboard operation
parsedatetime copied to clipboard

Configurable named times (breakfast, tonight, etc)

Open idpaterson opened this issue 7 years ago • 5 comments

Some of the named times are rather subjective (e.g. breakfast, afternoon) while others are not (e.g. noon, midnight). It would be great to be able to allow my users to configure, for example, what time breakfast (desayuno, Frühstück, etc) means to them. In my use case, tasks are being recorded with future due dates and reminders.

Currently these are stored in the locale, so there would be no reasonable way to change the time designated to a term across multiple languages. That might be okay since switching locales would be uncommon, but it is not optimal. I could handle this by presenting the user with the keys in locale's re_sources dict and allowing the time value for any phrases that happen to be there to be changed, but my app has no semantic understanding of what those phrases represent.

It may be more useful to map those to named constants so that the locale is represented consistently across locales as 'breakfast': source_times.BREAKFAST and 'desayuno': source_times.BREAKFAST. Those constants may be simple time values as the locales are currently configured, or functions that given a date return a time.

It is important to decide whether these terms represent the same time every day or if on certain dates (most commonly certain days of the week) the times are different. If I really want something to notify me "at breakfast time" when I am literally at the table eating then I would want to configure "breakfast" as 6:30am weekdays, 7:30am weekends. I would need to hear from others that this is useful before considering implementing it over a simple static breakfast is 6:30AM mapping.

idpaterson avatar Aug 30 '16 12:08 idpaterson