Use this tag for any question about handling date with Drupal or the Date module.

learn more… | top users | synonyms

0
votes
1answer
7 views

D8 date popup on exposed filter

How can I get a date popup on the exposed filters of a view on D8 ? I do not see the option, is it on D8 yet?
1
vote
2answers
43 views

How do I get the Unix timestamp?

I want to use format_date(), but it requires a Unix timestamp and my dates are ISO. Is there a drupal way to convert ISO date to Unix timestamp? If I use strtotime, I lose my timezone offset.
0
votes
1answer
14 views

How to disable auto submit on value change in date_popup form? [on hold]

Is there a quick way how to disable auto submit on value change in date_popup forms? Thanks.
0
votes
1answer
15 views

jQuery Datepicker : How to add option which accepts a function as an argument

I have added a date_popup field to a form : $form['arrival_date'] = array( '#type' => 'date_popup', '#title' => t('Arrival date'), ...
0
votes
2answers
57 views

How can I use 'xx time ago' for date format in drupal8 nodes?

How can I use 'xx time ago' for date format in drupal8 nodes ? I want to replace "xx time ago" with {{ date }} in node. In drupal 7 worked with this code : <?php print ...
0
votes
2answers
35 views

how to Display author and date information according to my requirement?

I am created a content type with field Title, Project code, Advertise and Body. I want to display Author name and date information after Project code but by default it showing after title field so ...
0
votes
1answer
21 views

How to compare current year with an integer field in Rules?

I would like to compare the current year with an integer field (let's say a "year of subscription" field) using Rules (if the field value is lower than the current year, the user has no access to a ...
0
votes
1answer
27 views

DateTime iso format in api

I have created an api that filter out unixtime format. Currently, we can filter using /api/blogs?filter[created][value]=1426766400&filter[created][operator]=">="&api_key=DEMO_KEY That ...
1
vote
2answers
24 views

modify date token in View to extract only year?

We have a content type using a date field, in which the date is entered in the format mm/yyyy. An example entry might be 04/2016. In one particular View, we want to use only the Year value. It appears ...
0
votes
0answers
22 views

Views - exposed date filter adds a timezone offset in query

In Drupal 8, when creating a view with an exposed filter on a Date field (which is in date only mode), the resulting query removes some hours based on my timezone. I'm in the UTC+2 timezone, so a ...
0
votes
2answers
17 views

How to reorder the date in a view expose filter?

I have created a view with date expose filter. Currently filter is working fine but i need to reorder the day and month. From month/day/year To day/month/year
0
votes
1answer
18 views

Filtering comment by date range in Views

I have created a view to filter comments by date range. For date range i am using between operator. View type : Comment Date : comment created (default field) Issue : When i am trying to filter ...
0
votes
1answer
14 views

Filtering date fields in Views - How can I test for NULL

* QUESTION EDITED - was previously two separate issues, now limiting question to one issue only * When I add a Date field to the Filter criteria, I get a choice of operators "Is less than", "Is less ...
0
votes
0answers
14 views

Restful API: Change date format from unixtime to ISO-8601 [duplicate]

Applying the date_iso8601 Drupal function in a simple process_callbacks on the public_fields in the class file for each date field works to convert the output/display of the date format, but does not ...
-1
votes
0answers
12 views

Different node title per date

I have content type with mutiple date field. Is there a module that can allow me to set different titles for different dates? So my Views can display different title depending on the current date. ...
0
votes
2answers
14 views

How to hide time from the date display?

In a view using Articles and Blog posts sorted by recent post date, I'm using [Content: Post date] and I would like to display (as a column on the display) as only the date and not the time, i.e. ...
0
votes
0answers
8 views

Don't show end-date for single-day event; show it for multi-day event

I have one multi-entry date field in an event content type. In the event view, I use multiple date fields with different date types to display the date as MMM dd-dd start:time - end:time The view ...
1
vote
1answer
21 views

Views event listing by date with up/down infinite scroll

I have a content type called "Event" which contains a "Date" field. What I want to achive: 1) Create a view which can display 5 events sorted by "Date" and displayed as following: 2 events which ...
0
votes
0answers
17 views

Validating dates while creating nodes

I have a content type of book leave. When the user created the node. I want to check whether the start date is less than or equal to end date. Start date and end date are date fields. How to acheive ...
0
votes
2answers
29 views

How to filter by month in view using a date field

I have a field called birthday that is defined for users. In views, is there any way to create a filter that filters only by month? Smallest values it lets me select is year and month where I only ...
0
votes
0answers
11 views

Exposed grouped filter for date not working

I have a view where I want to display "Past Events" and "Recent Events". I'm using the Exposed grouped filter. I have two problems: Sometimes I can't edit the relative date. When I edit to "now" ...
-1
votes
1answer
28 views

Is there any preprocess hook for date api?

As I asked in above, Is there any theme preprocess hook for date api in drupal? I want to Perform Some mathematical operations on Dates That show on any type of Contents, Is there a any way to a to ...
1
vote
1answer
37 views

Date token to use user timezone instead of site timezone

Our site is having users from different timezones and we are sending event notification emails using rules. We need to specify the event date-time in addressee's timezone. So, is there any way to ...
0
votes
0answers
26 views

Use custom end date field in calendar month with multiple day event

I have implemented a calendar month view (with calendar module) which renders all the Events CT nodes. I have created two separated Date fields for the start and the end date of the event. I haven't ...
0
votes
1answer
63 views

How should I use “DrupalDateTime” Class in Drupal 8?

I try to use "DrupalDateTime" Class to my Theme to show manualy date/Time in Custom Format and TimeZone in my nodes. I Add This code to my "ThmeName.theme" and "ThmeName_preprocess_node" section: ...
4
votes
1answer
22 views

How to create a filter in Views for filtering dates by day, month, or year?

I have a few thousand nodes with different dates as one of the fields. I am trying to create an exposed filter in views that allows the user to filter by day, month, or year. For example, I would ...
0
votes
1answer
43 views

How can I get Comment Creation Date?

How can I get Comments Added date of a node and convert it to custom format in my theme, I tried to make some operations on node comments date in "MyTheme.theme" file and in MyTheme_preprocess_comment ...
1
vote
1answer
61 views

How can I get Node Creation Date?

How can I get node creation date and convert it to custom format in my theme, I tried to make some operations on node date in "MyTheme.theme" file and in preprocess_node section.
0
votes
0answers
17 views

Drupal 8 views aggregation - maximum on date field

I am running a Drupal 8.0.5, I have a content type called show which has fields title, an entity referenced called movie and a date time. I am trying to create a view of the latest shows of each ...
0
votes
1answer
128 views

How to use Traditional (National/Native) Date/Calender in Drupal?

How can use Traditional Calender in drupal? I already used "format_date" function in theme files, but this function not locale-aware which means that it Always outputs English language data, such as ...
0
votes
0answers
13 views

How to split and link date field to view (imdb style)

I have created content type call person (list of persons) added a date field to content type (birth_date) how to split date to year/month (or should it be two date fields) how to link year to all ...
1
vote
1answer
33 views

Is this the proper way to add a 'class' attribute to a form date element

$form['stop_date'] = array( '#type' => 'date', '#title' => t('Stop Date'), '#default_value' => date("Y-m-d"), // default to today '#id' => 'stop_date', '#attributes' => ...
1
vote
1answer
44 views

Drupal 8 alter existing field setting

How to alter existing field type instead of creating new one to add new options with custom processing for insert and display of the field. Use case : upgrade hijri taarikh project that extends the ...
0
votes
2answers
24 views

text input in datepicker

how can i add some default text in my datepicker ? I want to add text in the box.
0
votes
1answer
11 views

Select node if there periods overlap

I have a content type that has a start_date and end_date fields. I need to make a view with a filter: start_period - end_period The view should select all nodes where the two periods overlap, for ...
0
votes
1answer
41 views

How do I verify that the form input date is valid?

Some browsers (e.g. Safari) allow rubbish dates to slip through a form Date field so that we get a fatal PHP error (Call to a member function format() on null) when we invoke the ...
1
vote
1answer
24 views

Change date on icon click event

I'm trying to create a custom block that display the current date (Only Day of the month, 2 digits with leading zeros and A full textual representation of the day of the week) using the tocken module. ...
3
votes
1answer
41 views

How to list nodes posted in current month?

I try to list nodes posted in current month, with Views. I tried to add a Contextual filter: Created: month, but no node appears. I tried a Filter criteria: Content: post date / Is equal to / An ...
-1
votes
1answer
70 views

Recurring Events

It appears there is no End Date or Date Repeat options for the datetime field in Drupal 8. Are there any contrib options for recurring events in Drupal 8?
0
votes
1answer
38 views

Date Popup does not translate date format

I am using date popup for a Italian site. In edit/node when in my_data_field I select the date it shows in English format mm/dd/YY and not in dd/mm/YYYY. Instead if I use the date popup in a exposed ...
1
vote
1answer
57 views

Change date format in Advanced Forum

I have changed date formats in Views and in Drupal core Date settings, but I'm still seeing wrong date format on forum (for example in node where conversation is) at class .forum-posted-on. In ...
1
vote
1answer
58 views

How to create a theme date view with CSS styles?

I created my view (datev) that contains two field (date and description). I renamed my template views-view-datev.html.twig and views-view-fields--datev---block.html.twig. I already have my CSS but I ...
1
vote
0answers
20 views

Unable to select date values in views filter(exposed grouped filter) implemented through Datepicker module on a Date Type form field

Pre-requisite knowledge: I have a view - All Albums to list all content of Album content-type. I have a field in Album content-type - Release Date of type Date. I use Datepicker module (enabled ...
0
votes
1answer
16 views

Drupal date_popup in FAPI conflicted with jquery.ui.core.min.js

When I use 'date_popup" in FAPI like below, $form['date'] = array( '#date_format' => 'Y-m-d', '#type' => 'date_popup', ); Getting below error. Uncaught TypeError: c.curCSS is not a ...
0
votes
0answers
7 views

Add a fall back filter to View using Taxonomies and Dates in Drupal 7

I have the vocabulary called "Event Categories" with the taxonomy values: Tour Workshop Exhibtion I have a content type called "ABC Event" with the following fields Title Date Event Type I ...
0
votes
1answer
27 views

How do I add repeating dates programmatically?

I have some JSON data I'm using to populate Drupal 7 database. This involves creating nodes with repeating dates. This is a sample of the data. [field_event_date] => Array ( [0] ...
0
votes
1answer
31 views

How to change date repeat display format

I am using date module & date repeat API but now i want to change repeat date format.Now repeat date is display in "Repeats 5 days " but i want to show only "5 days " instead of "Repeats 5 days"
1
vote
1answer
32 views

Setting date_popup year range to more than the 3 years default in Drupal 7

I have a custom module and using date_popup. Currently the popup only shows a 3 year range in the date popup. $form['startdate'] = array( '#type' => 'date_popup', '#title' ...
2
votes
1answer
28 views

Date format help

I am trying to add Japanese date Y年 n月 j日 in fields but the date is being displayed 2016年 2月 6日 年月日 . I want to remove 年月日 at the end of the date it indicates year month and day. 2016年 2月 6日 is exact ...
0
votes
0answers
13 views

Ajax form hidden default value not returning values when ajax runs

I have a custom where I need to render a calendar, but only shows the whole week of the current week. I've added an element for the date where I've set the default value to something like below ...