1

A date field in views allows you to show a start date and/or an end date. If the end date is optional, and not filled out by the user, views doesn't show a blank field if it is empty-it's show the start date for some reason.

This issue is similar to How can I rewrite a date field "End Date" to be "present" if no value is entered?

I have tried messing around with the code in the above issue to meet my needs but it's not working.

I have views php installed and I need to add php code to show the field label and date but leave the date portion as blank, if empty. e.g. End Date: 2017-09-20 or if empty End Date:

These are my available variables

$row->field_start_date: Content: Position start/end date (Set to display only start date)

$row->field_start_date_1: Content: Position start/end date (Set to display only end date)

2

To answer my own question:

I used the Views Conditional module and set it up as follows:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.