org-chef icon indicating copy to clipboard operation
org-chef copied to clipboard

Convert times to consistent formats

Open Chobbes opened this issue 7 years ago • 1 comments
trafficstars

Currently org-chef just spews whatever into the time fields of recipe (prep-time, cook-time, ready-in). So it could end up being anything...

30m, 30mins, 30min, 30 mins, etc.

org-chef should have a consistent format for times.

Chobbes avatar Feb 25 '18 20:02 Chobbes

I think the following format is reasonable:

[number of minutes][space]["min"]

Since,

  • The unit min can be enforced as seconds are utterly irrelevant while cooking and if the recipe takes longer than 60min, we can still have the code convert it visually to, say, 1h 30min or 1.5h.
  • The space as separator makes it trivially easy to separate the number from the unit.
  • The min is the SI defined shorthand for a minute, as m is already taken for the meter, and mins implies a plural, which is never used in SI units.

If we agree on this format, we can write a org-util to trim, expand and convert the typical variations of how times are written to this single format.

michaelbogdan avatar Oct 17 '19 23:10 michaelbogdan