When creating a program playlist for a particular day (e.g. 12th Apr 2007) the date appears in the playlist name as "4-12-2007". Can we choose from a list of different formats, e.g. 12/04/2007, 12th Apr, 2007, etc, like when you configure a date cck field in a content type. A custom date entry box would be really good! Again, the date cck field has this. Or at the very least can we have an option for a European style date (day-month-year)?

Cheers,
Stella

CommentFileSizeAuthor
#1 station_playlist_dates_135568.patch4.8 KBdrewish

Comments

drewish’s picture

Status: Active » Needs review
StatusFileSize
new4.8 KB

good idea. here's a patch that should do it. please test it out and let me know if it meets your needs.

stella’s picture

that works great, thanks for the quick turnaround!

Cheers,
Stella

drewish’s picture

Status: Needs review » Reviewed & tested by the community

you're welcome! i'm all about feature requests that are simple and provide a functionality to a lot of people. flexible dates is a great one. i'll get this committed tomorrow.

stella’s picture

Status: Reviewed & tested by the community » Needs work

Hi again,

So the date part of the patch is ready to be committed. However, some additional code changes crept into the patch and caused the addition of new playlists not to work. The section of the patch is:

@@ -296,10 +322,9 @@
   if (isset($node->program_title)) {
     $prog = node_load(array('type' => 'program', 'title' => $node->program_title));
     if ($prog) {
-      $node->program_nid = $prog->nid;
+      form_set_value($form['program_nid'], $node->program_nid);
     }
   }
-
   if (!isset($node->program_nid)) {
     form_set_error('program_title', t('A valid program name must be provided.'));
   }

It's because $node->program_nid isn't set for new nodes. Reverting this patch section, fixed everything again.

Cheers,
Stella

drewish’s picture

i'd rolled those changes in on purpose to move the code from _submit to _validate. i'll do some testing creating new playlists.

thumb’s picture

Is the playlist date field at all influenced by the sitewide date format? Can the format be altered through a theme with format_date()?

drewish’s picture

it doesn't use the sitewide date format because it includes time information, and the module only tracks the date so you'd get a 0:00 or 12:00 in each date string.

drewish’s picture

Status: Needs work » Fixed

okay i fixed that bug and committed this to the DRUPAL-5 branch

dries’s picture

Status: Fixed » Closed (fixed)