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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | cck_time.module.patch | 2.64 KB | jhedstrom |
| cck_time.module.txt | 9.34 KB | capellic |
Comments
Comment #1
jhedstromI needed something similar. Here's the changes I made in the form of a patch against 5.x-1.1
Comment #2
joey santiago commentedhello,
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
Comment #3
TaPes commentedperfect, thank you!
Comment #4
kenorb commented6.x issue: #766832: Accept empty values if CCK Time field not required
Comment #5
Everett Zufelt commentedNo longer providing support for 5.x. If this issue is still relevant for 7.x or 6.x then please re-open.