Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 167

DateTime objects provide information about a given date/time.

1 vote
Accepted

Entry not saving when date isn't changed using frontend form

Something I'd not done with the edit form was replace [new1] with [{{variant.id}}] for the variant inputs. As I said, the form was saving correctly anyway if I changed the date, so I didn't expect cor …
Clive Portman's user avatar
1 vote
1 answer
117 views

Entry not saving when date isn't changed using frontend form

When editing an entry (actually it's a product within Craft Commerce but everything seems the same) with a pre-existing date, the field looks like this: <input name="fields[date][date]" value="06/12/ …
Clive Portman's user avatar
1 vote
1 answer
312 views

Date-time field within tables

I'm after using a date-time field within a table cell. I suspect it requires a plugin to make this happen - has anyone done this?
Clive Portman's user avatar
4 votes
Accepted

Filter out duplicate entries in array?

Holy moly! I've solved it already, Batman. Check the array before adding the event to it, like so: {% if event not in categoryEvents %} {% set categoryEvents = categoryEvents | merge([event]) …
Clive Portman's user avatar
2 votes
1 answer
2k views

Filter out duplicate entries in array?

I have some matrix fields containing a date. I then loop through the entries in a category looking for entries containing a matrix field with a date during the next month. Everytime a matrix field is …
Clive Portman's user avatar
2 votes

Is it possible to compose a DateTime object from a string?

with a string: {% set yearbegins = '1 January ' ~ year %} // getting year from a url (dynamic route) {{ yearbegins | date("U") }} // outputs the date in Unixtime Are you saying this is not a real datetime
Clive Portman's user avatar
2 votes
1 answer
769 views

Return entries with startDate or endDate within a calendar year

I have two date fields in my entry and I want to return those entries with either a start date OR and end date within a calendar year. I can get those with a startDate within the calendar year using: …
Clive Portman's user avatar
2 votes

How to display entries with a custom date field within month

Okay, here's the answer: {% set thisMonthsEvents = craft.entries.section('events').eventDate('and', '>= ' ~ firstDayOfMonth | date("U"), '<=' ~ lastDayOfMonth | date("U")) %} Maybe this has somethi …
Clive Portman's user avatar
3 votes
3 answers
2k views

How to display entries with a custom date field within month

I've got a date field, and I'm grabbing the month and year from the url. What I'm after is to display all the events within the month, but for some reason I can't get this to work {% set firstDayOfMo …
Clive Portman's user avatar