Score:0

Rewriting Start and End Dates in Views where Date is stored in single field

do flag

using Drupal 7, I have the Profile2 module installed. Within that, I have a field called "Employment Dates" and a user can enter a start and end date on this field. They can also leave the end date field blank.

I then have a view that has this field. It works well when there is a start and end date (for instance it will show Aug 2012 to Aug 2016 if that's the values entered) but when there is only a start date it shows Aug 2012. I would like to do a re-write to show Aug 2012 to Present when the end date is null/blank. I've tried repeating the field and then setting each one to show only start and show only end respectively, but the when only one date is entered the same date displays in both fields. I've also tried installing the PHP View field to allow creating a PHP field, but I've struggled with the re-write.

Would appreciate some advice.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.