I wanted the option of not having to fill out the time. I added blank items to the hour, minute and meridem array and then changed the error handling to be sure that if any of the time fields were defined, that they were all defined.

I have attached the module file here for your review and consideration.

CommentFileSizeAuthor
#1 cck_time.module.patch2.64 KBjhedstrom
cck_time.module.txt9.34 KBcapellic

Comments

jhedstrom’s picture

Status: Active » Needs review
StatusFileSize
new2.64 KB

I needed something similar. Here's the changes I made in the form of a patch against 5.x-1.1

joey santiago’s picture

hello,

needed the same thing. your patch didn't work for me... just had to add one line.

i'm not able to make a patch, so i write here what's needed.

line 158 (case'validate', case 24) just add:

$node_field['meridem']=-1;

and that's it. If not, when your time is in 24 hours format, you of course don't have a value for $node_field['meridem'] and the next if doesn't work.

hope it's useful for someone.

EDIT:

went quite nuts about it. It looks like if the time's not set, on the database it saves '-' so this value is displayed. i decided to modify the file content.module adding at line 1051

if ($item['view']=='-'){
$item['view']='';
}

this of course won't allow me to have any field whose value is '-' showed, but who cares? not elegant, but working. If anyone knows why cck_time puts '-' on the database in stead of '', please tell me! :) thanks

TaPes’s picture

perfect, thank you!

kenorb’s picture

Everett Zufelt’s picture

Status: Needs review » Closed (won't fix)

No longer providing support for 5.x. If this issue is still relevant for 7.x or 6.x then please re-open.