I made different improvements to the code replacing the verbose definitions of JS arrays with calls to drupal_js.
As a bonus I implemented long versions of day and months.
Tested on Drupal 6.
Minor fixes and other additions:
- indentation and variable naming ($out becomes $output, that is more Drupal-style)
- in the theme function td's to have classes and not id's, id's should be unique and they weren't (the other way round would be to give them unique id's as you are doing with worlclock)
- changed theme function to accept $timestr as a parameter, hence giving the change of printing the date() in case JS is disabled (addressing #256624)
- added support for n and W (DOW (1 - 7) ISO-8601 or (0 - 6))
By the way, as per Drupal guidelines http://drupal.org/handbook/cvs/quickstart#commit and http://drupal.org/node/52287, I'd be grateful if you mentioned my nickname on the commit messages.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | wc_codestyle.patch | 8.08 KB | flevour |
| #1 | wc_drupal_jsification.patch | 6.84 KB | flevour |
| #1 | wc_unified.patch | 13.5 KB | flevour |
| drupal_goodness_worlclock.patch | 12.94 KB | flevour |
Comments
Comment #1
flevour commentedI realized I didn't include the patch for the JS file. I am uploading separated patches for each of the above points so you can track them better. I have broken them down as follows:
- wc_codestyle.patch: minor indentation and variable naming fixes
- wc_drupal_jsification.patch: all other modifications mentioned above (including JS this time)
- wc_unified.patch: 2 patches above in a single patch
Comment #2
flevour commented"Hence giving the change of printing the date() in case JS is disabled (addressing #256624)": I wasn't considering timezone issue when I added this, thus I am marking this patches as "need work".
"wc_codestyle" is still valid though. I'll re-roll the "wc_drupal_jsification" and "wc_unified" asap.
Any feedback on these anyway?
Comment #3
flevour commentedCommitted to D6-dev.