We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Best way to record time for human readable and microdata format

How Do I?

Jeremy S.'s avatar
Jeremy S.
353 posts
9 years ago
Jeremy S.'s avatar Jeremy S.

I’ve been working on this recipe site project and I need to store/output several different times for a recipe.

There is Prep, Cook, Inactive and Total time.

An example of the rendered code with microdata would be: <time datetime=”PT1H30M” itemprop=”totalTime”>1 hour 30 min</time>

I’m trying to sort the most efficient, and flexible way to store these 4 times that won’t paint me in any corners in the future. I would love if ee had only a time field instead of date/time field, but that’s not the case.

Aside from that, all I can think of is a grid.. Any other option I may not be considering?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

There’s really no need for a time field, since it’s just the amount of minutes you want to store. They behave like any other numerical field, just use regular custom fields (with no formatting, of course).

       
Jeremy S.'s avatar
Jeremy S.
353 posts
9 years ago
Jeremy S.'s avatar Jeremy S.

Well yes and no. Since I need the hours and minutes to be separate (general flexibility and microdata generation), a time field would have been nice as I could output in the template using time formatting (%g and %i) etc. where needed and have only 4 fields (Prep, Cook, Inactive and Total time).

But with keeping the value of minutes and hours separate for the 4 durations in text fields or a grid results in 8 fields or columns respectively. That’s why I was just curious if there was another good option I hadn’t considered.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.