khal icon indicating copy to clipboard operation
khal copied to clipboard

get rid of config variables `datetimeformat` and `longdatetimeformat`

Open geier opened this issue 10 years ago • 6 comments

We should be able to concatenate date (longdate) with time, or is there any country where one would usually use another notation for dates and times than for datetimes?

This would a) simplify configuration and b) some internals could become cleaner (at least less code).

Example:

configured: timeformat: %H:%M dateformat: %d.%m. longdateformat: %d.%m.%Y

infered: datetimeformat (dateformat + timeformat): %d.%m. %H:%M longdatetimeformat (dateformat + timeformat): %d.%m.%Y %H:%M

geier avatar Jun 15 '15 17:06 geier

Why don't we also use timeformat and dateformat from the user's settings (eg: LC_TIME), instead of having our own extra config? This would let us integrate easierly, and clean up code a bunch more.

WhyNotHugo avatar Jun 17 '15 21:06 WhyNotHugo

At least as a default this would be a good idea.

geier avatar Jun 17 '15 22:06 geier

LC_TIME isn't set on my system, I don't assume it is a popular envvar to set. It's sensible to use it as default if it's there, but I don't like the idea of it replacing khal's config, because that would mean that some things in khal are only settable via envvars while other things are defined in the config.

untitaker avatar Jun 17 '15 23:06 untitaker

Regarding the original question: I think it might make sense to some to choose a different delimiter than a space.

untitaker avatar Jun 17 '15 23:06 untitaker

LC_TIME isn't set on my system, I don't assume it is a popular envvar to set.

If undefined, I believe LC_ALL defines your time format. Or some other LC_ I can't recall right now.

WhyNotHugo avatar Jun 20 '15 17:06 WhyNotHugo

I have recently seen people using - as a seperator, e.g., %Y/%m/%d-%H:%M

geier avatar Feb 06 '17 12:02 geier