Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hello
when i print the date value like this :$node->field_date_event[0]['view'] i get an (All Day) printed behind it, but i don't want it ...
what can i do?
sometimes i have events with hours : minutes - sometimes not.
so my granularity is including hours : minutes, but i do not need them always.
thanks momper
Comments
Comment #1
momper CreditAttribution: momper commentedhello
do i something wrong?
thanks momper
Comment #2
KarenS CreditAttribution: KarenS commentedIt's a theme, you can override it to show nothing. The theme is called 'theme_date_all_day_label' and it is in date/date/date.theme.
Comment #4
yakker CreditAttribution: yakker commentedI'm not sure if I'm right about this or not (i'm not a coder), but I think theme_date_all_day() may be appending "all day" to ANY dates with:
1. NO 'to date' ('never')
2. Granularity < day (ie. hour, min, sec).
The conditional test seems to check whether or not there is granularity = to hour, min, or day, but also to see if there's a mincomp and maxcomp value. But in the switch statement, the mincomp and maxcomp values are automatically assigned because of the granularity. So there will always be mincomp and maxcomp when granularity is hour, minute or second.
With no "to date," the $mincomp and $maxcomp get created from $date1 and $date2, respectively, and both $date1 and $date2 have the same value.
But there doesn't seem to be a comparison check between date1 and date 2. If they're equal, it should default to the regular formatting, right? My apologies for any confusion if I'm wrong about any of this. :S
Comment #5
embirr CreditAttribution: embirr commentedI can't confirm or deny what the code says, but if you set granularity in the Date field to "day," the "All day" label disappears.
Comment #6
Encarte CreditAttribution: Encarte commentedThere is an example of how to do this on this message: http://drupal.org/node/386406#comment-1325736 (endorsed by KarenS here: http://drupal.org/node/386406#comment-1331578). Worked for me.
Comment #7
jerodfritz CreditAttribution: jerodfritz commentedWhen you added the Date field to your CCK type you selected the amount of granularity to use. By default Year, Month, Day and Hour is selected. Unselect hours and the (All Day) will disappear.
-Jerod
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedJust for those who wonder how to get ride of the (all day) and are lazy to go check the previously mentionned link, this, pasted in template.php in your theme, will remove every instance of it :
Comment #9
mikejonesok CreditAttribution: mikejonesok commentedThanks for the tip!
Comment #10
bryanhidalgo CreditAttribution: bryanhidalgo commentedThanks
Comment #11
wayne.gormont CreditAttribution: wayne.gormont commentedJust what I was looking for! Thanks so much!
Comment #12
bardya CreditAttribution: bardya commentedSimple but deadly! thanks
Comment #13
lfrey CreditAttribution: lfrey commentedDoes it matter where you paste it? I tried this and the whole site broke - I got a white screen.
Thanks - all help greatly appreciated.
Lynne
Comment #14
bardya CreditAttribution: bardya commentedYou can paste it anywhere , i usually paste it at the end of the file. There may be something else that is causing this error. What you are seeing is the infamous drupal white screen of death which is covering the error. To see the specific error check out this post:
http://drupal.org/node/158043
Good Luck,
Comment #15
lucio.ferrari CreditAttribution: lucio.ferrari commentedHi, I tried this fix. Since the theme I use is 'pixture reloaded' I added:
but it doesn't seem to override theme_date_all_day_label()...
Am I doing something wrong? I'd like to avoid messing with date module's templates, since I'd prolly forget about any custom changes when upgrading.
Thanks in advance.
Comment #16
lucio.ferrari CreditAttribution: lucio.ferrari commentedFixed.
Changed to
flushed cache and now it works.
Not sure of what of the above did the trick, tho.
Comment #17
jhans CreditAttribution: jhans commentedHi
it did the trick. Thanks but know there is an space character at the beginning which looks not really very good. Another chance to return a null value. The first solution works but 00:00 is returned.
Thanks
Joachim
Comment #18
Ingumsky CreditAttribution: Ingumsky commentedIn his post #4 yakker made a statement I wanted.
The behaviour of the date module sometimes is really annoying.
My situation:
1. latest stable date module;
2. no _to_ date field (set to never) ;
3. granularity is set to "minutes";
4. Time zone handling is set to "Users".
Almost all users can see correct date and time but some of them receive that "All day" thing that clearly upset them. Why did they see that? Because of their time zone - when it's December 2nd, 6pm in UK it is December 3rd, 12am in Almaty. The date module cannot handle it properly. And those lads wonder what the hell with their time settings at my website. And I'm quite sure there's the same issue with any dates set to 12am and Users time zone disabled.
I don't want to use the workaround mentioned above and disable date_all_day_label theming function because I need "All day" functionality on some nodes but I want to find a solution.
Comment #19
rlmumfordIs this the same for drupal 7?
Comment #20
tim.plunkettThis was fixed as of comment #2. Comment #18 might be a duplicate of #1041428: Improper logic in date_field_all_day.
Comment #21
jasom CreditAttribution: jasom commentedor you can print this to avoid error and have no (even empty) characters:
Comment #22
endiku CreditAttribution: endiku commentedI find the template.php solution to be heavy handed and not a true solution. I state my case #1017216: custom date format without time shows "all day"
The real issue is that custom date/times created in Admin->Date and Time, that are created to display no time at all are ignored and display "All day". Even if you create a custom date display of "M d" which does not refer to time at all, if the date is an zero time/all-day time then "All day" will display. This means that Date's theme_date_all_day function is in conflict with custom date creation. This obviously affects Views use of custom date selection but goes beyond Views as custom Date and Time is really a core issue.
If a custom date/time is created that explicitly does not display time then "All day" just shouldn't be showing up. Tampering with template.php is not a real solution here.
Comment #23
tim.plunkett@endiku, the theme function exists for that purpose. I wouldn't call it "heavy-handed".
Comment #24
2dareis2do CreditAttribution: 2dareis2do commentedMany thanks
Comment #25
wiizzard CreditAttribution: wiizzard commentedThis bug still exists for me in 7.x. Patch from #21 gives me 00:00 instead of nothing.
I have also tried it with patch applied from #1041428.
Comment #26
tribsel CreditAttribution: tribsel commentedhi! what if you want to show date in some view without 'All day' appendix and but somewhere else with that appendix (like in the calendar).
Comment #27
btopro CreditAttribution: btopro commentedTheme Agnostic "fix" to this issue (at least in D6, didn't test in D7)
Comment #28
KarenS CreditAttribution: KarenS commentedPlease don't move issues from one version to another, the code is totally different. Plus this is already an issue that has veered off in too many directions.
Each issue should be about one problem in one version so we can focus on that problem and close it when fixed.
Comment #30
fmitchell CreditAttribution: fmitchell commentedBetter than doing a theme override, remove the granularity from your field settings (also required to remove the timezone) from 'hour, seconds' to just day.
Comment #31
Ingumsky CreditAttribution: Ingumsky commented>>fmitchell
You didn't get the point mate. The problem is: there're some values _with_ hours and minutes set and at the same time there're some values _without_ them. Let me explain: I have two events (i.e football games) scheduled on June 23th and July 23th. I know kick-off time for the first game is 3pm but I don't know when another game will start. Granularity settings can not solve the issue for me.
Comment #32
marcos.518 CreditAttribution: marcos.518 commentedthanks lucio.ferrari owe you a lunch. =)
Comment #33
diannaL CreditAttribution: diannaL commentedNot sure if this will be of any use to anyone (but you never know). For various reasons only our developer has access to the code of our Drupal site so we were forced to find a solution to this problem using only views. (His time is very limited too)
*Our events are a mix of All Day events and by hour slot events, so we couldn't change the CCK field granularity.
We wanted a list of upcoming events split by month in the view.
To make this happen we had to create a field for the month (trimmed to three characters, and excluded from display) and a field for the year (trimmed to four characters and excluded from the display). Then add these together in a custom text field.
Sort in the table by this custom text field.
Comment #34
jayson CreditAttribution: jayson commentedHi momper and others who may be interested, I know this post is old and closed, but I had the same problem as you did just now. I have an date event with a time granularity, but I want to allow some dates with time and others without - but I never want the "(All day)" to appear. Here's how I solved it:
I updated my template.php file and added this code to the end of the file:
Then, I put this in my stylesheet to hide the (All day).
.date-all-day-info {display:none;}
I like this solution best because I did not have to patch the Date module, and can now control the display of the (All day) easily through my stylesheet.
I'd recommend that the module developer simply put a span tag around the (All day) info in their module and this will allow us all the flexibility we need.
Hope this helps,
Jayson
Comment #35
JohnLinux CreditAttribution: JohnLinux commentedThis is misleading. removed the option of having hours and minutes on your site. and no timezones
Comment #36
commonpike CreditAttribution: commonpike commentedI don't see what's misleading about what @jayson said. It works and disables nothing, but i had to fix the 'date_t' call:
and
.date-all-day-label {display:none;}