I am adding a feature for dates with optional end dates to let the user control whether or not to see an enddate. If the end date is empty (or matches the 'From' date) it isn't shown, unless the user checks the box.

This required some theme rework to wrap all the date field collections in a single div that #states can find. I have to test that it won't break anything else before committing this, but it should be coming shortly.

CommentFileSizeAuthor
#2 Before.JPG20.77 KBarlinsandbulte
#2 After.JPG19.03 KBarlinsandbulte

Comments

karens’s picture

Status: Active » Fixed

This is committed.

arlinsandbulte’s picture

Status: Fixed » Active
StatusFileSize
new19.03 KB
new20.77 KB

Looks like this commit removed the "From Date" & "To Date" labels from the date fields. See screenshots.
Was that intended?

karens’s picture

I did that on purpose. I am trying to compress the amount of space it takes up and mimic the Google calendar options. They don't have 'From' and 'To' labels on their date fields. I added a light border around each so you can see which date parts go together.

If people don't like that we can put the labels back.

arlinsandbulte’s picture

Status: Active » Fixed

OK, that is good enough for me.

Status: Fixed » Closed (fixed)

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

dboulet’s picture

Removing the labels causes display problems when the fields are required, see #1248786: Fix appearance of marker for required date fields.

Also, it's now not entire clear to user that the first date is a start date and the second is the end date. This could be fixed by #1248720: In-Line 'End Date' with 'to' text., but still leaves the problem of the required field marker being abandoned.

kmajzlik’s picture

Status: Closed (fixed) » Active

Any option to make this checkbox always checked?
I use "end date optionaly", but it means one more click for user. If they do not check it then value is ignored(i tried this simple thing: .form-type-date-popup { display: inline-block !important; } ). Not a good for CRM etc application where people works all worktime.

I tried: hook_form_alter(); theme_form_element(); theme_date_popup(); (with respecting names of module/theme of course) and nothing helped me.

I would like to prefer to set it in field settings instead of making JS.

Prague man’s picture

Subs.

arlinsandbulte’s picture

Status: Active » Closed (fixed)

Followup issues are actually duplicates of this: #1250626: Add start date and end date labels

Original issue here is fixed, so I am setting it back that way.