1

I'm trying to sort entries on a page by a custom field, by date and time. I have sample data over several entries with different dates and times, and where I want it to show the date of the event, it shows "January 1, 2016" (with the correct time) for all events, instead of the date and time of the eventStartDT field.

{% for entry in craft.entries.section('events').order('eventStartDT').limit(4) %}

    <div class="uk-width-large-1-3 uk-width-medium-1-2 uk-width-small-1-1 uk-container-center" style="margin-bottom:25px;">
        <a class="fpcLink" href="#">
            <div class="frontPageContent">
                <div class="fpcInner">
                    <span class="text-content"><span><i class="uk-icon-calendar uk-icon-large"></i><h3>EXPLORE</h3></span></span>
                </div>

                <div class="fpcLower">
                    <h3>{{ entry.title }}</h3><p>{{ entry.eventStartDT | date('F n, Y - g:i A') }}</p><p class="uk-text-small">{{ entry.shortEventDescription }}</p>
                </div>
            </div>
        </a>
    </div>

{% endfor %}
3

Okay, I feel supremely stupid.

I put

date('F n, Y - g:i A')

Should be

date('F j, Y - g:i A')

Total brain fart. ಠ_ಠ

| improve this answer | |
  • Thanks for following up with an answer, Dustin! Don't forget to accept it. – Matt Stein May 9 '17 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.