Questions tagged [datetime]

Use it for questions about handling date or time through any module. Don't use it if you are already using "calendar" as tag.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

Changing existing date time field

I am working on an already existing site that has content. There is a content type with field date and time. I need to remove the time component and just be Date only without deleting any content ...
1
vote
0answers
17 views

How can I change the date format for user submitted data in confirmation emails

The confirmation emails sent by Webform (running under Drupal 8.9.7) on submission are in US format "m/d/Y" for all date fields that the user entered on the form (but not for system ...
1
vote
0answers
23 views

Posting date when a submission is made

I am a newbie at Drupal, so apologies if I am missing something obvious. I searched the issues with various keywords but could not find a similar problem. I need some data to be sent via remote post ...
2
votes
1answer
107 views

Date Field Type - Text Field Widget is Gone?

I am noticing that the Date field type only has the availability of three widgets: Select list Date and time Select list, no time Can someone tell me why the "Text Field" widget is gone? ...
0
votes
0answers
22 views

How do I modify the Scheduler date picker?

On the date picker for the Scheduler module, I would like to modify it. Specifically, I would like to make it so a content creator can set the time to be unpublished 120 days from now, rather than ...
0
votes
1answer
11 views

In Views, when using a filter on a datetime field, what is the time zone of the offset?

When I use an offset like "-4 hours" in a Views filter on a datetime field, which timezone is used? More details In Views, when I add a filter for a datetime field, I get the following ...
0
votes
0answers
26 views

Comparing expired date with current date

I am trying to compare the current datetime with my duedate to check if the duedate has expired, and run some code if that is the case. $d = date(strtotime($deadline->get('field_date')->...
0
votes
0answers
32 views

Date time save in database

I have two very basic vanilla installation of Drupal 8. One I have installed a few months back, and one I installed today. I have an identical datetime range field in both of them. But I noticed that ...
1
vote
1answer
21 views

How do I translate the weekday in a date?

I created a view from a JSON file; the dates in that file follow the 2020-07-28 20:00 format. I do a rewrite of the date to <span>{{ value_1|date("l d/m/Y") }}</span> and I get ...
0
votes
0answers
35 views

How do I change the date format of a date field?

How to change date format of date field? I'm using webform module. There is no date format field to set it. Also read somewhere that changing default date format of "short" format will do ...
0
votes
0answers
12 views

Get upload date of a file

On my Drupal project, for a local cycling club, on the pages that show the different routes we'll be doing there is a link to a gpx file that contains the route details. Since routes change often ...
0
votes
0answers
21 views

Update/Changed field not updating programatically in node

I'm creating a node programatically in D8 and passing the value for update field explicitly. When the node is created it sets the update value which is provided, but when the same node is updated the ...
1
vote
1answer
28 views

How can I show a date in Urdu?

I am working on printing dates in more than a language. With Drupal 7, I used the following code. <span class="arabic-date"> <?php $arrayurdudays = array('', '', '', '', '', '', ...
0
votes
1answer
55 views

Why doesn't my date get rendered?

In Drupal 8, I have a Flag entity with a date field attached. My code looks like this: function MYMODULE_flagging_presave(FlaggingInterface $flagging) { if ($score == 0 || $score == 1) { $...
0
votes
0answers
11 views

Filter view results by “created”/“authored on” date - shows all content regardless of post date

I've been throwing myself at this for a while, apologies if I've missed anything stupidly obvious. I'm trying to create a table of statistics for content submitted by all users (using Views Aggregator ...
0
votes
0answers
9 views

Display only specific months which has data in the exposed filter, Views

I have a view where i am displaying data from one of the content type and i am filtering the data based on month and year, selected from the exposed date filter. I have added the date field in the ...
0
votes
0answers
18 views

Views aggregation is turning my date field to integer

Edit: This is a duplicate of Maximum on date field and Views aggregation issue. I've made a view using aggregation on a date field (revision created date). I want to show the minimum date for a group ...
1
vote
1answer
89 views

How can I programmatically set date field Month, Day, Year dropdowns in Paragraphs?

I'm setting a basic date field (and several other text fields) programmatically when creating a paragraph. The database is showing that it is getting my date, which is being stored inY-m-d\TH:i:s ...
1
vote
1answer
39 views

Change exposed filter date format with Search API

We are using Search API for a customer website and we have a View with a start and end date exposed filter. The view only filters correctly if we use the m/d/Y format, which is not valid in Brazil, ...
1
vote
1answer
88 views

Programmatically set the value of a date/Time field

I am trying to copy the value of a Date/Time Webform element to a Date/Time field set on the article node. Below is the source code of the Date/Time Webform element: expiry_date: '#type': datetime ...
0
votes
1answer
54 views

Change the value of a taxonomy field on cron run

I have the article node with two extra fields: Taxonomy reference field field_verification_status with two possible values: Valid (tid: 272) Expired (tid: 271) Date field (field_article_expiry_date)...
0
votes
0answers
27 views

Upcoming birthday list in views, based on birth date

In Drupal 8 I created some extra fields at "user", such as date of birth" (dd-mm-yyyy) I want to show in a block in views the upcoming birthdays. BUT...I can't sort them on date, because the order ...
0
votes
0answers
18 views

How do I set granularity to an END date value used as sort criteria?

I have a Date field with start and end dates (mm-dd-yy). I need to build a View listing nodes grouped by end date year and sorted first by descending end date year and second by ascending title. ...
0
votes
1answer
339 views

Filter nodes by today's date

Following what described in Views filter criteria date field is greater than current date, I have used operator >= today with some success. I would like to create "future" nodes and they should be ...
0
votes
0answers
13 views

Are there any solutions that integrates custom mysql datetime field with views?

I created my own table with a mysql datetime field via hook_schema. The code that defined the field is here 'timestamp' => [ 'description' => 'The timestamp value when the recipient ...
0
votes
1answer
132 views

How to limit form submission per user per day and week?

The goal is very straightforward. I need a form to limit each user to 1 submission per day and 3 per week. What I found: Webform: The "Form settings" in webform has the "Per user submission limit" ...
0
votes
0answers
78 views

Date range issues with timezones in twig

We're using date ranges for some events in an application. We're finding that when we use the date value and end_value independent of one another then the timezone is incorrect. For example, inside a ...
0
votes
1answer
51 views

How to translate the month name in a date select list field?

I have created a date field in user account fields. In manage form display, I have selected Select list as widget. I want to translate the month names which is displaying a select list. I checked it ...
0
votes
1answer
47 views

How to display date and time picker for base field on custom entity

I've made a base field on a custom entity with type "datetime" using "datetime_default" for the form display. It's displaying as only a date picker, with no time component, whereas I want it to look ...
0
votes
0answers
28 views

Full node shows a different datetime(hour) value than the same field in a view

I have a content type with a "date and time" field. I have populated this field using core json post using this format 2020-02-19T13:25:00. This works good and field is filled. When I add this field ...
0
votes
0answers
22 views

How to update default value of a datetime field?

I have a content type 'News' with a datetime field. I'm trying to alter its default value depending the choice of another field. So, i added some AJAX in the form : <?php /** * Implements ...
0
votes
0answers
21 views

Render date in the correct timezone

I'm trying to display render the "event" day in my custom tpl. I save in that node 31/01/2020 - 20:30 If I check the table (this is a field collection), the value stored is 2020-01-31 19:30:00 ...
0
votes
0answers
156 views

How to display date range facet filter in Drupal 8?

I am using a date range field in my content type. I have installed search api and facets modules. In the node index, I have selected the Date range type for the date field. I have created a facet ...
0
votes
0answers
21 views

Field gets unset and fails validation in user edit form

We have a special date field that we set upon user creation when our custom user form is submitted. The user does not have to set this field themselves. We have a separate form, which is a user edit ...
0
votes
1answer
69 views

Change default format for date field on user register form

I'm new to Drupal 8. In the user registration form, i've added a Date field via manage fields in user account settings. However, I need to customize this field and change its format. I tried 'manage ...
2
votes
1answer
32 views

In views, how do I show posts from this calendar day, ten years ago?

I have a view in which I want to display posts that I made on this date 10 years ago. I can get close but not exactly what I want by setting the view's filter to the following: "Authored On is ...
0
votes
0answers
17 views

Date difference with taxonomy field

I'm using D8 and I have a little problem with calculating age. I have a taxonomy term "Animal". It has a "name" and "date of birth" field. I have a content type "Test Results". It has a "date of ...
0
votes
1answer
54 views

How can I display the time passed since a comment was created instead of the creation date?

how to personalize my comments ? I want to display since when the comment was created instead of the date. I want to display the comment ID with the link "permalink". Can you help me ? Thank you ...
2
votes
1answer
110 views

How to Restrict views Date popup to only year/month

I want to have views exposed filter on node created field with popup. I've installed date_popup, the popup appears but I'm looking for a way to restrict it to only year and month. I tried the ...
-3
votes
1answer
34 views

I would like to create a field type “Time” [closed]

not within or as a date. If I use a number field, I'm not able to display a colon instead of comma or decimal dot. How would you solve this problem?
0
votes
0answers
49 views

how to convert a timestamp into a date format in a custom module [duplicate]

I created a custom module and printed this outcome in .csv. Name,Event,Email,Timestamp Ea Iustum Jus,Fifa,example@asdf.wer,1573924224 How do I convert the timestamp in a date format? I tried with $...
1
vote
2answers
253 views

How to change the date format in the date field as a select list?

On user registration page, I have added a date field in select list. In the manage form display tab, I can set the order of the dropdown fields like day/month/year or month/day/year But I am unable ...
0
votes
2answers
106 views

How do I programmatically save “2019-11-04 07:30:00+01”?

I have "2019-11-04 07:30:00+01" as datetime value. I am not getting how to handle the "+1" part in a Drupal 8 date field. I am using this code, but it's not giving me any value. use Drupal\Core\...
0
votes
1answer
27 views

Combining Date Start and Date End in Drupal 8 Views Block

I am new to Drupal 8 Views - How do you concatenate Event Start Date Sept 1, 2019 with Event end Date ie: Sept 4, 2019? The end result is they just want the Month and Day to show up like this Sept 1-4....
0
votes
1answer
567 views

Views date exposed filter by year in checkboxes

I have date field. In views I want to add the a date exposed filter. This filter will only display year and we can select multiple years. Just like this I have checked the better exposed filter ...
0
votes
1answer
53 views

Filter excludes date in end date field

I have a view in Drupal 8 as below. [The date column in below list, is not an event. its order item. so date showing is order complete date only] When I filter with start and end date, the data shown ...
-2
votes
1answer
2k views

Calendar/datepicker popup not working on safari

Below is the date type form field I have in some form which renders on chrome correctly. $form['date']['air_date'] = array ( '#type' => 'date', '#title' => t('Air Date:'), '#required' =&...
0
votes
0answers
67 views

Views exposed date filter range format

I have a view with an exposed filter for a date range. I use jquery ui datepicker to select dates. It works good and I can select dates in spanish format (dd/mm/yyyy). But when I apply the filter, It ...
1
vote
0answers
27 views

Instantiate DateTime with localized time [duplicate]

I'm trying to migrate some data from MySQL DateTime format. Here's one: $old_date = "2019-05-06 08:00:00" My content type has a custom field using DateTime. Using the info from SO links below, I ...
3
votes
1answer
146 views

Date input format problem

I need to import a large dataset (over 300,000 records) into a Drupal 8 site. I have figured out how to do this with feeds on a small test dataset. The dates in the records are in the format June 8, ...

1
2 3 4 5
24