Questions tagged [postdate]
The postdate tag has no usage guidance.
50
questions
0
votes
1
answer
19
views
Entry's post date in multisite
we are using multi-site setup to run 2 websites in different languages. We share articles between both sites and display some of them on the home page as "recent articles". Since the ...
1
vote
1
answer
665
views
Get entries with a specific post date
I'm having absolute brain fog right now.
I'm trying to show a list of entries with a given postDate
{% set startDate = startDate ?? now|date('Y-m-d') %}
craft.entries
.section(['jobs', '...
1
vote
1
answer
120
views
{{ entry.postDate|date }} Variable "entry" does not exist
Might be basic, but not sure where I'm doing wrong. I was trying to display the post date of an article using this code
{{ entry.postDate|date('medium') }}.
But getting the error stating "...
0
votes
0
answers
17
views
Can control panel date display always be numeric?
I understand the display of entries' postDate, etc., in the control panel can be localized, but I'm wondering if it's possible to get rid of the "yesterday" and "today" designators,...
1
vote
2
answers
396
views
Displaying updated date for entry
I want to display the date an entry has been updated if it is later than the post date. So I've tried this:
{% if entry.dateUpdated >= entry.post %}
Updated on {{ entry.dateUpdated.format('...
1
vote
1
answer
50
views
SuperSort `rsortAs` error with `postDate`
In Craft CMS Twig template I am trying to sort Entries by post date using SuperSort.
An old template on Craft CMS 3.0.17.1 PRO is using:
{% set products = products | supersort('rsortAs', '{ postDate ...
1
vote
2
answers
110
views
How to change the day of the week?
Good day!
I display the day of the week on the site {{ now|date("l") }}
How to change for example Monday to Mondays (on Mondays)?
Thanks in advance :)
1
vote
1
answer
22
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
1
answer
83
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
1
answer
54
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
...
2
votes
2
answers
66
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....
3
votes
2
answers
2k
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 ...
1
vote
1
answer
230
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 ...
2
votes
1
answer
686
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 ...
1
vote
1
answer
90
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
1
answer
38
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 ...
2
votes
2
answers
200
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
1
answer
194
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
1
answer
484
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. ...
3
votes
1
answer
1k
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 ...
1
vote
1
answer
3k
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
0
answers
173
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 "...
4
votes
1
answer
606
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 ...
1
vote
1
answer
43
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',
'...
3
votes
2
answers
592
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 ...
0
votes
1
answer
438
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 ...
3
votes
3
answers
864
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 ...
1
vote
1
answer
104
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 ...
2
votes
1
answer
234
views
How do I check if an Entry is new?
How can I check if an Entry was posted less than a month ago?
1
vote
1
answer
490
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 ...
2
votes
1
answer
1k
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
1
answer
203
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 ...
1
vote
1
answer
64
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
2
answers
415
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 ...
3
votes
1
answer
276
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 ...
2
votes
1
answer
297
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
1
answer
214
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.
...
3
votes
1
answer
434
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)....
1
vote
1
answer
500
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?
5
votes
2
answers
7k
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 ...
3
votes
1
answer
2k
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: ...
10
votes
1
answer
799
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.
1
vote
1
answer
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 ...
4
votes
1
answer
303
views
Cached entries and postDate / expirationDate [duplicate]
How does the {% cache %} tag handle a situation where an entry reaches its post date or expires?
5
votes
2
answers
633
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?
4
votes
3
answers
1k
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 ...
7
votes
2
answers
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 ...
3
votes
2
answers
636
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, ...
4
votes
4
answers
290
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 ...
5
votes
2
answers
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 ...