I'm trying to display a saved date from a json file. I currently have:
{% set batchRowStats = craft.analytics.loadSavedBatch() %}
{% for stat in batchRowStats %}
<tr>
<td>{{ stat['senddate'].date }}</td>
</tr>
{% endfor %}
And the information in the JSON file is:
[{"batchid":368,"total":1111,"opened":0,"clicked":0,"optout":0,"bounced":0,"subject":"subject line","senddate":{"date":"2017-06-02 06:00:22.000000","timezone_type":3,"timezone":"UTC"}}
I am getting this error:
Impossible to access an attribute ("date") on a string variable ("").
Which I am assuming it's because this information may be in a DateTime or object of sorts. I really need to just display "June 2, 2017" with a date_format but I'm not even sure how to get the string to display.
{{ dump(stat['senddate']) }}
, what does it output? – Brad Bell Jun 20 '17 at 17:24