In my content types I set the calendar to allow for an End Date, but not as 'required'. Yet, each time I create an article type, the end date is defaulting as set to the start date. Is that normal? Or can I have the end date as an option, but by default not set?

Thanks.

Files: 
CommentFileSizeAuthor
#43 date-fixshowdate-1442718-43.patch605 bytesj0rd
PASSED: [[SimpleTest]]: [MySQL] 5,238 pass(es).
[ View ]
#34 date-1442718-34.patch674 bytesBoobaa
#20 showenddatefix-1442718-20.patch674 bytesbones
PASSED: [[SimpleTest]]: [MySQL] 5,237 pass(es).
[ View ]
#9 Show End Date.PNG9.38 KBwusel

Comments

Yes, I have same problem. I think this is Date -module Issue? I using version 7.x-2.1.

and when I am updating event comes an error...

"There are errors in Date value #1:
The End date must be greater than the Start date."

.... because the End date field is empty

Project:Calendar» Date
Version:7.x-3.x-dev» 7.x-2.x-dev
Status:Active» Fixed

This has nothing to do with Calendar.

You have several options for the default -- it can be the same as the start date, blank, or relative to the start date (like +1day).

Status:Fixed» Active

I have my default end date value set to "no default value", but when I create a new piece of content, the end date prepopulates with the start date. (I'm not using Calendar, just a content type with a Date field.)

Status:Active» Fixed

Hi, why that Show End Date checkbox default value is always checked?

When I updating my event (and when there is only start date) comes error...

"There are errors in Date value #1:
The End date must be greater than the Start date."

.... because the End date field is empty

Then I always have to unchecked that checkbox...

Status:Fixed» Active

In my configuration, "show end date" has no default value, but the checkbox is checked by default when creating a new node. This isn't a big problem; I just uncheck the box, and the node saves without issue.

However, if I go back and edit the node, the "show end date" checkbox is checked again and I have to remember to uncheck it again or else the form throws a validation error. Not ideal -

Category:support» bug

Title:Calendar Setting Default End Date"Show End Date" always checked by default when creating or editing a node

StatusFileSize
new9.38 KB

When I import an Event with a date-field using Feeds, the new Event has NO end-date, because in
Show End Date
"Show End Date" is ALWAYS set, but the fields for the end-date are NOT shown.

The logic of this field "Show End Date" is NOT correct:
If it is checked, then the fields "date and time" are NOT shown. If it is NOT checked, then the fields "date and time" are shown.

[update - 03/03/2012]
This prevents Feeds from importing the end-date und -time.
[/update]

I use:
D7.12
Date 7.x-2.2+0-dev (2012-Feb-25)
Entity API 7.x-1.0-rc1+40-dev (2012-Feb-24)
Feeds 7.x-2.0-alpha4+39-dev (2012-Feb-09)

Thanks.

Status:Active» Fixed

This was broken when I tried to fix problems created when you hide a field that has a default value. Made a change to try to fix that.

http://drupalcode.org/project/date.git/commit/9ec980a

Status:Fixed» Active

I'm still having a problem with this - I've installed date 7.x-2.2+3-dev which includes the changes in this commit.

But the behaviour I still see is:

  • Create event node with Show End Date unticked & only add start date/time and save.
  • Edit the same node & you'll see that the Show End Date box is ticked
  • If you save the node without unticking the box, you get an error saying : There are errors in When value #1: The End date must be greater than the Start date.

I've installed "date 7.x-2.2+3-dev", too.
My #9 is not solved yet.

The text "Show End Date" is wrong, it must be "Don't show End Date" (the module date shows the end date field depending on this text).
But the import-module Feeds (and may be Migrate) thinks, this option is "Show End Date" and not "Don't show End Date".
So it sets this option in the wrong way during import.

If I add an new event ("http://example.com/node/add/event"), this is the same.

I hope, you can understand our problem and help us soon.
Thank you very much.

Please have a look at #1467830: Step-by-step instructions: Timezone-handling is wrong / editing and importing of date-fields are different.
With "Event 2" you can test this very well after building that scenario after step one or two.

I am also experiencing the bug exactly as described in #11.
I have nodes with lots of date fields, some with end date and some without. I have to uncheck the Show End Date for each date with no end date every time I edit.
Using Date 7.x-2.2 at the moment. Is this last commit intended to fix this problem or the other issue in #9?

This is a problem which I tried to tell the # 1. I tested latest dev version, and i have to uncheck the Show End Date when editing dates with no end date... Is this bug or feature?

I also still see this bug (It's really not user-friendly, so - bug.) in the latest version of dev.
"show end date" should not automatically check itself when editing an existing node.

Perhaps this will help with figuring out the problem:
On line 299, $instance['required'] is coming up "true" even though to date is optional. The field is required though - and I think this means that with a required date field (even with optional to date), the "show to date" check box will always be checked.

Suggestion:
change line 299 from
$show_todate = !empty($form_state['values']['show_todate']) || !empty($element['#default_value'][$to_field]) || $instance['required'];
to
$show_todate = !empty($form_state['values']['show_todate']) || !empty($element['#default_value'][$to_field]) || $field['settings']['todate'] == 'required';

Same here:

"Show end date" should not automatically check itself when editing an existing node.

Whenever someone edits a node that doesn't have an end date, the show end date checkbox is still checked, and the user must manually un-check that box before saving the node, otherwise the warning will appear saying the end value must be greater than the start value... a little confusing, to be sure.

I am in the same boat as #18. Every time I edit a node the "show end date" box is checked. Un-ticking the box simply does not stick.

Not a huge deal, but will be a headache for clients and content editors, because you need to un-tick the box every time you edit the node or the node will not save.

Status:Active» Needs review
StatusFileSize
new674 bytes
PASSED: [[SimpleTest]]: [MySQL] 5,237 pass(es).
[ View ]

Fix in #17 seems to work for me.
Attached is a patch.

Just manually applied patch in #20, and pending the testbot's test returning a pass, I'm RTBCing this patch; works perfectly on my site, fixes the problem, makes sense.

edit: sorry did not use latest dev :s

Status:Needs review» Needs work

(ignore, had to use latest dev)

Status:Needs work» Needs review

Status:Needs review» Reviewed & tested by the community

RTBC patch in #20. Passed testbot, and everything works great on my local machine.

The patch applied cleanly to the latest -dev. You need to use the -dev version, apply the patch AND set the Default end date to "No default value", otherwise the Show end date option will still be checked upon node creation.

Status:Reviewed & tested by the community» Postponed (maintainer needs more info)

I am unable to replicate this problem in the latest code. I need a specific example of how to see something that is broken. I followed the instructions above and they all work fine for me.

I need to know the type of date field, the settings for the field, the type of widget and the settings for the widget.

Could be something from older versions of the Date module, perhaps. I'll create a test site and see if I can replicate on a fresh install.

Status:Needs work» Postponed (maintainer needs more info)

Step-by-step instructions to reproduce the problem:

Set the site-timezone to "Europe/Berlin".
Visit /admin/structure/types and click on "Add content type": Name = "Event", click on "Save and add fields". In line "Add new field", select Type of data to store = "Date (ISO format)", Label ="Event-Date", Field name = "field_event_date", Form element to edit the data = "Text field", then click on "Save".
On the page "Field settings": set "Collect an end date" to yes and "Time zone handling" to "No time zone conversion" and then click on "Save field settings".
On the page "Event settings" set "Required field" to yes and then click on "Save settings".
Visit /admin/structure/types/manage/event/display and on "Custom display settings" set all options (like "Teaser") to no and then click on "Save".
"Add content", select "Event": Title = "Event 2", set "Show End Date" to no, then change nothing, click on "Save".
Then edit "Event 2", change nothing and then click on "Save".

Status:Postponed (maintainer needs more info)» Needs work

Status:Postponed (maintainer needs more info)» Needs work

My set up is similar to #29 but will confirm anyway:

Fieldtype: Date (ISO format)
Widget: popup calendar
Default value date: now
Default value end date: No default value
Required field: yes
Number of values : unlimited
Date attributes to collect: Year, month, day
Collect end date: yes
End date required: no
cache dates: no

#20 works.

Status:Needs work» Fixed

I was having a lot of trouble replicating this, but finally was able to. Should be fixed now.

http://drupalcode.org/project/date.git/commit/ce80670

StatusFileSize
new674 bytes

Here's a patch that applies cleanly to 7.x-2.2 for those poor souls like me who work with that.

Patch in #34 works for me with 7.x-2.2. Thanks @KarenS and @Boobaa!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Active

Can't we have an option to choose behavior of end date on field setting page to show/hide end date by default

Status:Active» Closed (works as designed)

Sorry, it was simple just to remove default value for end date

Status:Closed (works as designed)» Closed (fixed)

More appropriate status.

Title:"Show End Date" always checked by default when creating or editing a nodehaving default end date after clicking new menu
Component:Code» Views Filter
Assigned:Unassigned» Nallu
Priority:Normal» Critical
Status:Closed (fixed)» Active

i have start and end date filter where i have set cookies for start and end date as i need but it works 1ly if i click the( "today", "this month" ) buttons if i go to new menu the end date changed to today date.Help me plz i need my cookie to work there.

Title:having default end date after clicking new menu"Show End Date" always checked by default when creating or editing a node
Component:Views Filter» Code
Assigned:Nallu» Unassigned
Priority:Critical» Normal
Status:Active» Closed (fixed)

Hi Nallu,
The bug reported above was fixed already. If you have another problem or need support, you should create a new issue.
It's best not to rename issues as it can make it more difficult for people to find help.
Cheers,
Matthew

IMHO, This patch is not valid. Correct me if I'm wrong, but I did previously fix this problem in my install, and since upgrading it persists.

But there's two issues here, which is eluded to in #12

The current behaviour of that checkbox is "DO NOT SHOW END DATE". That issue is displayed in comment #9, notice how the checkbox is checked, but the end date is not shown.

Only local images are allowed.

$element['#default_value'][$to_field] will always !empty() if the date field is set to default to current date (i believe this is the default) and if the node has been saved ($element['#default_value'][$to_field] gets set to $element['#default_value'][$from_field])

Valid Logic for this patch I believe is

<?php
$show_todate
= !empty($form_state['values']['show_todate']) || (!empty($element['#default_value'][$to_field]) && $element['#default_value'][$to_field] != $element['#default_value'][$from_field]) || $field['settings']['todate'] == 'required';
?>

But still this doesn't make sense because of reverse UI logic some where else.

Issue summary:View changes
Status:Closed (fixed)» Needs review
StatusFileSize
new605 bytes
PASSED: [[SimpleTest]]: [MySQL] 5,238 pass(es).
[ View ]

UPDATE. I didn't look at the code slightly above this, which will remove value2 via some logic. So my post above is invalid, except for the point I make about logic is reversed.

With that said, for my install at least (jquery_update is installed, but most #states work) I've had to flip the logic in #states to make it work as expected.

I can confirm on my live server, when viewing a node with "Start and End Date" that "Show end date" is checked, but only 1 input is displayed to end user.

And then only "start date" is given that "Show end Date" is unchecked, and both inputs are displayed.

The included patch is against 2.7, not -dev.

Other related issues.
#1246286: Problem with 'show end date' check box
#2042499: Show End Date incorrectly checked depending upon user creating/editing node.