tags:

views:

29

answers:

0

What's the best method of storing the duration of an activity in a MySQL Table if there are 3 possibilities:

Activity lasts the full day Activity lasts only half a day User specifies the length in Hours:Minutes

The UI has a combobox with (Full Day/Half Day/Manual -> here a hour:minute selector shows up).

I am thinking of storing the duration in minutes in the database. And replace a Full Day with 480 minutes, half day with 240 minutes.

But I do not like the solution too much, cause in the frontend I need to check the duration and e.g if it is 480 set the combobox to Full Day.

What about an additional Field Type: 0 - Full Day 1 - Half Day 2 - Manual

Wondering what the better/cleaner solution would be, or if there is a 3rd, better solution.

Thanks, martin