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

learn more… | top users | synonyms

1
vote
1answer
15 views

Change date format of a single result in a view

I have a view that gives me a list of nodes titles and when it was last updated. I want to display the changed date with only time if it is today, otherwise i just want the date. i.e. 17.00 Title ...
0
votes
1answer
20 views

How to add select years and months select Drupal 8.1 date picker?

There is no configuration option available in the backoffice nor from configuration synchronisation variables that allows to edit the settings for the jQuery datepicker widget embed in core. My ...
0
votes
0answers
20 views

Date Popup Script throws an error

I have installed date 7.x-2.8 module. Enabling Date API 7.x-2.8 , Date pop-up 7.x-2.8 and Date popup timepicker 7.x-1.0-beta1 . I have this form element: $form['myid_summary']['summary_from'] = ...
3
votes
1answer
40 views

Display Today's Birthday in Block

I have a Content Type 'Teams' which have name as Title field, Image field and Date of birth field using Date module. I want to display Today's birthday in block. I've tried using views but could ...
0
votes
1answer
11 views

Multiple dates token for auto node title

I am using this token to create node title [node:field-date-concert:custom:j-m-Y] and it works fine if there is one value for date in node. Problem is that if there are 2 or more values i only get ...
3
votes
1answer
28 views

How to assign content to user for manage turns?

I need to create a system to assign turns to a people register in the site, for this need contemplate: The administer assign turn to user in specified place.ex(turn 1, place 1, user 1) There are two ...
2
votes
1answer
21 views

How to add time element to open date and close date when adding a quiz

I am using the following modules. Quiz, Version 7.x-4.0-rc2 Date, Version 7.x-2.9 When adding a quiz, in the availability options tab, I want to be able to set the time as well. In the open ...
1
vote
0answers
31 views

Expose date filter in view

How can I configure an exposed filter so that users can filter my site content by creation date, preferably using a date picker? I tried using Content: Authored on as filter, but it gets me a text ...
0
votes
0answers
5 views

added date filter to one of the views shows ajax error:length undefined

I have added a date module to my site and used date filter in views i.e. to search news content through date. This filter works fine in preview section, but in main page it shows Ajax error as length ...
-1
votes
0answers
20 views

drupal 8 date format [duplicate]

I use date field in content for show time ago in dupal8 . Now I want change date for since edit time . For example - date field is hidden After create content : 3 minutes ago After edit : 3 ...
0
votes
1answer
14 views

Get clean date without any HTML tags

I am using the Date module together with a view to display dates, and I need to get the date timestamp. The problem is that $fields['date_in_timestamp'] content comes wrapped in HTML. <span ...
-1
votes
1answer
51 views

change date format in drupal8 node

I use date field in content for show time ago in dupal 8 . Now I want change date for since edit time . For EX ( date field is hidden ) Create content date show : 3 minutes ago Edit content date ...
0
votes
2answers
15 views

Date from to views how to do? [duplicate]

I want to create filter for nodes that were created from and to..... Date looks like this 05/02/2016 - 05:07 I created date field and selected post date and input this date above and it did not ...
0
votes
0answers
23 views

Entity Metadata Wrapper: set Date Field with unknown Timezone

I need to create nodes programmatically and I chose to use the helpful EntityMetadataWrappers. But I have a real doubt about setting datefields. I found in this thread (and checked on my code) ...
0
votes
1answer
13 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
57 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
15 views

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

Is there a quick way how to disable auto submit on value change in date_popup forms? Thanks.
0
votes
1answer
18 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
74 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
36 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
25 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
35 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
30 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
28 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
21 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
20 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 ...
0
votes
2answers
15 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
26 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
33 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
15 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
29 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
39 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
30 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
70 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
26 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
44 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
68 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.
1
vote
0answers
26 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
137 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 ...
1
vote
0answers
14 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
35 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
63 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 ...
1
vote
2answers
25 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
25 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. ...