Questions tagged [postdate]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
10
votes
1answer
638 views

How can I cache a list of entries with pending postDates and have it automatically invalidate the cache appropriately?

I have a listing page of entries, some of which may have future-dated postDates. I want to cache the output, but only until one of the pending entries goes live.
6
votes
2answers
1k views

How can I display a “pending” entry in my “_entry” template?

I have an event site with dates in the future and past. I know how to display future entries as a listing: {% set entries = craft.entries.section('mySection').status('pending') %} But how do you ...
5
votes
2answers
4k views

Adjust all date/times to users current timezone

I've done a bunch of research and I can't seem to find a suitable answer for this issue without hacking which I'd like to avoid. My client needs the entries in the DB to always assume they're ...
5
votes
2answers
535 views

How to set entries to auto-expire after certain # of days from post date?

Is there any way to set entries of an certain entry type to auto-expire after a certain number of days from the original post date?
5
votes
2answers
1k views

Creating a date filtered archive template

I'm trying to create an archive list template that lists entries from a News or Blog Channel based on year/month/day combinations. However, I get no entries and can't see where I'm going wrong...I'm ...
4
votes
4answers
283 views

No ordinary news post ordering

I'm trying to work out how I can order news posts by postDate, unless a lightswitch is toggled for a post, at which point it will use the dateUpdated to order that item. This is so a client can still ...
4
votes
2answers
997 views

Display Entries in a calendar

I have a section for holding calendar entries stored by postDate in the CMS. On the front end I want to basically display these in a calendar. I have code which displays the calendar looping through ...
4
votes
1answer
342 views

How to only show entries older than 12 months

I want to build an archive template where only entries older than 12 months show up. Is there an clean and easy way to do so? I only have strange calculations in mind. Something like this would be ...
4
votes
1answer
267 views

Cached entries and postDate / expirationDate [duplicate]

How does the {% cache %} tag handle a situation where an entry reaches its post date or expires?
3
votes
3answers
514 views

Updating the postDate field from a plugin?

I think I'm almost there with this one but obviously missing something as the postDate is not updating. I have the following in an onSaveEntry event. It's saying it's successful but the postDate does ...
3
votes
2answers
324 views

Using user-selectable timezones to show localized post dates

In my user profiles, I have a text field where the user's timezone is set, in the standard America/New_York format. Craft's timezone is set to New York, and the server's timezone is set to UTC. I'm ...
3
votes
1answer
1k views

How to filter entries by month and year?

I'm taking the month and year from parameters in the url like this... {% set month = craft.request.getParam('month') %} {% set year = craft.request.getParam('year') %} The url would look like this: ...
3
votes
2answers
311 views

Entry Post Date Format time since - X days ago

Is there anyway to get my date formats looking like Facebook? I'd like to get my articles to have this as a date format: "5 min ago", "yesterday", "3 days ago", "4 months ago" and then once it reaches ...
3
votes
1answer
212 views

Formatting Slug {postDate.month} to 2 characters

We are migrating our site into Craft, which is by and far easy and pleasant. But I'm trying to match our old CMS's permalink structure, which used 2-character months in the URI. When defining the ...
3
votes
1answer
401 views

How to translate de postdate format for a multilanguage site

I have a site with 2 languages: Nl and En Everything translates to Dutch but only the date stays in English... I use this to get my news items: {% for entry in craft.entries.section('news').limit(6)....
3
votes
2answers
553 views

Import Plugin date format (Post Date postDate)

Having much success with the Import Plugin I've also raised this here, but thought this forum perhaps better. I'm trying to force through a Post Date on my imports, but nothing is being respected, ...
2
votes
1answer
704 views

Filter entries by month

I'm trying to make a archive page for a blog sorted by months. I tried to consult the solution from Linking and showing archive by month, but I can't get it to work like it should. The code I have now ...
2
votes
2answers
57 views

February always comes out as March - expect /yyyy/mm to be 2018/02 but it's 2018/03

This is a site that was recently updated from Craft 2 to Craft 3 and before the update this issue did not occur. Here is the code: {# all entries sorted by year/month #} {% set allEntries = craft....
2
votes
1answer
943 views

Get entries by date range from plugin

Im trying to figure out how to get Entries by date range, say I would like to get all Entries from one week back, or I would like to get all Entries from a specific month. I find some Twig examples, ...
2
votes
2answers
158 views

Has anyone come up with a solution where matrix blocks can be scheduled and expire?

To replace my current CMS I will need to have parts of pages change without the whole page change. As I'm looking at using matrix blocks for building pages, it would seem to be easy for an editor to ...
2
votes
1answer
128 views

Adding a postDate with Guest Entries

Is it possible to set the postDate for a new (disabled) entry created using the GuestEntries plugin? Otherwise when posting a GuestEntry the postDate is not set until the entry is enabled or re-saved ...
2
votes
1answer
130 views

Targeting the first entry item

I'm using Craft 3 and have created a section (channel type) for my project entries. At the bottom of each project page I have my Prev and Next Project buttons. How do I target the first and last ...
2
votes
1answer
174 views

How do I check if an Entry is new?

How can I check if an Entry was posted less than a month ago?
2
votes
1answer
257 views

Setting Date from URL

I have a template, /calendar, which outputs a list of all entries from the events channel. If a user clicks a link for "July 2015", I want the same template to load showing only the events for July ...
1
vote
2answers
327 views

Output postDate in a different language than CP

How to retrieve the postDate of an entry in a different language than the CP. In the general config settings i have the following, 'defaultCpLanguage' => 'en' But i would like to display the ...
1
vote
1answer
1k views

CException Craft\MatrixBlockModel and its behaviors do not have a method or closure named “postDate”

As of Craft 2.2 build 2579 / 2581 I get an error upon save for entires in a section that uses postDate in the URL and in the {slug} CException Craft\MatrixBlockModel and its behaviors do not have ...
1
vote
1answer
34 views

Date range to include end date

I am grabbing a date range from a URL query string like so: https://website.com/qa/search-feedback-results?datestart=2019-01-01&dateend=2019-02-26 I can't figure out how to include posts that ...
1
vote
1answer
48 views

Include Time In PostDate/DateTime Field Control Panel Display

In Craft 3 if you use a DateTime field and have it set to time only, it still displays as a date in the Control Panel with no time. Even if it is used as a date and time field, just like entry post ...
1
vote
1answer
272 views

Order a paginated entry by postDate

I'm stumped trying to order paginated entries for a channel. The end goal is to have listings with the most recent postDate at the top. The code below has the most recent item third instead of first. ...
1
vote
1answer
67 views

postDate keeps jumping ahead when editing an entry

When I edit an existing entry the post date jumps ahead by an hour meaning I have to manually remove it before saving the changes. I thought it may have something to do with the timezone but this is ...
1
vote
1answer
435 views

Showing posts live during a date range

I've tried to follow a ton of other articles posted on Stackoverflow for showing posts between 2 dates. I just can't seem to get it working and I keep getting an error of: Call to a member function ...
1
vote
1answer
59 views

Display postdate Spout Forms entries

I'm trying to display the postDate of Sprout Forms entries. The docs state that you can use standard Craft CMS tags. I tried: {% for formEntry in craft.sproutForms.entries.formHandle('contact').order(...
1
vote
1answer
358 views

Is it possible to remove an entry's Expiration Date?

Once I have given an entry an expiration date, is there any way to delete that date so that it never expires?
1
vote
1answer
12 views

Displaying a month name in an archive

I'm trying to figure out how I can print the month name i.e April in the below. Currently, it's printing the last three months that contain entries. {% set year = craft.request.segment(4) %} {% set ...
1
vote
1answer
37 views

Archive page date logic stopped working

Edit: This is confirmed as a bug in Craft, that will be fixed in its next release. If you're running into this, please see the temporary fix over at GitHub: https://github.com/craftcms/cms/issues/3772 ...
1
vote
1answer
103 views

Get categories ordered by the associated entries' postDate

I'm looking to show recent categories ordered by their associated entries' postDate. Is this possible? I don't want to list the entries within the category I simply want to list 4 categories that ...
1
vote
1answer
20 views

Override the postDate for entries so their URL works on the frontend?

Is it possible to override/disregard the postDate for all entries in a section so that they are visible on the frontend even if this date is in the future? I realise I could add a dedicated date ...
1
vote
1answer
2k views

DateTime::__construct(): Failed to parse time string

I want to get the lates postDate of a List and format it for the cache tag {% set latestSubmission = craft.amForms.submissions( { formHandle: 'reservation', order: 'dateCreated desc' }).datum('&...
1
vote
1answer
39 views

Entries by non-contiguous postDate years

I'm trying to display and paginate entries by years, that aren't necessarily contiguous. {% set limitPerPage = 6 %} {% set eagerFields = [ 'title', 'press_release_name', '...
1
vote
1answer
177 views

Show entry on certain date, regardless of year

A project I'm working on needs to show a daily reading depending on the date you access the page. I plan to create entries for each day of the year, and each year it will show the post for that day. ...
1
vote
1answer
86 views

CP search for entries by postDate?

Does the control panel search support postDate, expiryDate, dateCreated, dateUpdated? For a custom date field, the below will return all dates in October 2017: customDate:2017-10 But for entry ...
1
vote
0answers
117 views

Submit Dropdown with ajax

This works for me, but i would like to solve this with ajax without reloading the page. Choosing the values from the Dropdowns and submit the data per POST Method, so i can return the value with "...
0
votes
1answer
378 views

Dropdown that shows all months and when selected displays all entries from that month

This snippet displays every post by postDate, which lists a bunch of “October 2015”. I am trying to filter by month/year, so only one “October 2015” shows then one “November 2015”, then one “December ...