Closed (fixed)
Project:
Webform
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2010 at 03:52 UTC
Updated:
3 Apr 2010 at 02:20 UTC
Jump to comment: Most recent file
In an effort to make #254957: Allow sorting on any column in the Results table page and #680386: Views integration for the webform_submitted_data table more feasible, we should convert our date storage from using 3 separate rows to storing dates as timestamps, making them sortable and easier to handle with Views.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform_date_time_convert6.patch | 19.94 KB | quicksketch |
| #1 | webform_date_time_convert7.patch | 17.84 KB | quicksketch |
Comments
Comment #1
quicksketchI've merged this issue with #712352: Convert time component to use seconds in the day (timestamps), since both issues will use essentially the same format.
After speaking with KarenS, the maintainer of Date/DateAPI, I've decided not to use timestamps, but to use ISO 8601 strings. This format states that dates and times be formatted as such:
Datetime: yyyy-mm-ddThh:mm:ss
Date: yyyy-mm-dd
Time: hh:mm:ss
There are a lot of varieties of allowed formats but this will be the set of formats we use. This format has the following advantages:
- Doesn't mess with timezones at all, much less probability for error when converting back/forth from timestamps.
- Still sortable
- MySQL and other datbase systems provide special mechanisms for handling dates in this format.
- Like timestamps, only takes up one row in the database but without the hassle of trying to figure out what timezone the timestamp is in.
After putting together the patch, I found this significantly reduces our logic in a couple of places (things like the analysis page especially). This patch keeps to the focus of converting the data storage, though there are plenty of areas for improvement in our reporting and analysis pages.
Same as other patches, this does not address data migration in the Drupal 7 version, which is being postponed until we can upgrade Drupal 6 core to Drupal 7 core.
Comment #2
quicksketchI've committed these patches to both branches.