I Need to write a view for representing data using Views_Timelinejs within a range of dates, but I need to display data according to month only.how do I filter by month granularity in views.

Comments

iStryker’s picture

Title: how to add timeline only with month » How to add timeline only with month
Priority: Major » Normal
Issue summary: View changes

Changing priority. I have an idea of what you want, but I cannot help as I do not completely understand your broken English.

You marked this as a feature component, so this makes me assume you are trying to extend the feature.

dcam’s picture

Version: 7.x-1.x-dev » 7.x-3.x-dev
Category: Support request » Feature request
Status: Active » Fixed

There should be more than one way to do this with the new 3.x branch. It is technically still in development, but is basically ready for a beta phase. If you still have need of this feature, then please consider testing it.

Method 1. Use the new Display Date field to override the text displayed for the dates. MySQL (and by extension Drupal) require a complete year, month, and day date to be input into Date fields. Using TimelineJS3 and a 3.x branch of this module, you can enter any text into a Display Date field and override whatever dates you were forced to input by your system.

Method 2. This will require more configuration initially, but should save you from having to override all of your dates. The views plugin will parse any date that matches a PHP datetime format. See http://php.net/manual/en/datetime.formats.date.php. Formats that only include a month and year are listed there. Set up a new format in Drupal at admin/config/regional/date-time and then configure your timeline view to output the date in that format.

Note that method two will cause all of your dates to be output with only a month and year, even if you wanted some events to include a date or time too. Still, if you're certain that you only want months and years then this is the method I would recommend.

Status: Fixed » Closed (fixed)

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