humanmade / hm-time

6 stars 3 forks source link

Working Hours #3

Open missjwo opened 10 years ago

missjwo commented 10 years ago

At the moment the spec seems to suggest that you only one start time and one end time.

Is it your intention to only have one of each or do you want to allow for users to create multiple start/end times.

A use of the latter idea is for a person who wants to do 4 hours from 6am-10am and then has errands to do and then goes back to work at 2pm-6pm.

The latter feature could always be implemented later but it could effect the design of the data storage now.

joehoyle commented 10 years ago

Funny you say that, I was literally thinking exactly this about an hour ago! Yeah, I think we should do it. Perhaps every user just has:

array(
    array( 'start_time => x, 'end_time' => 'x' ),
    array( 'start_time => x, 'end_time' => 'x' ),
    array( 'start_time => x, 'end_time' => 'x' )
)

Etc?

missjwo commented 10 years ago

Your idea is pretty much how it would have to be if we are storing it in the user meta table - but serialised arrays can get so ugly so quick. Unfortunately, the build of a new table just for the plugin seems overkill though.

joehoyle commented 10 years ago

Hmm yeah, I don't see us wanting to query based off this data, so I don't see an immediate problem with serialized data.