1

I am wondering how to format dates so that:

When the start and end date are in the same month, that the start and end date is displayed like 1 - 2 March 2015

When the start and end date are in different months display dates like 12 March - 4 June 2015

When the start and end date are in different years display the dates like 12 June 2015 - 4 June 2016

Any help will be highly appreciated Thanks

3
  • more details please ,,, because this question look like a general php question and not related to the drupal ,, from where you get your date ?? where do you process the values ?? Commented Mar 25, 2015 at 19:42
  • I have created a view that uses an Event content type that has a start and end date. Commented Mar 25, 2015 at 19:59
  • Different date formats for a single view with multiple attachments. But it really depends on your exact needs. Commented Mar 25, 2015 at 20:06

2 Answers 2

0

my preferred solution is to do it manually

1- install and enable views php module

2- add the start date and end date fields to the view but without display them

3- add the php global field after the date fields and write some little php code can achieve your target

0

In case anybody stumbles on this in future:

The date range formatter module does smart combination of start and end dates and allows for a wide range of formatting flexibility.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.