Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi to all, In Umbraco v8 I created a blocklist for events.
I would to show (as label) the title and date of a single event.
Title is ok, but the date not.
I set the "Label" field as follow:
Event: {{ eventTitle }} - {{ eventDate | date : "dd/MM/yyyy" }}
The result, in content node, is:
Event: 75° Festival di Cannes - 2022-05-21 00:00:00
But I expected it to be:
Event: 75° Festival di Cannes - 21/05/2022
Can anyone help me to correctly format the label?
Thank you
Adriano
Hi Adriano,
That should be correct according to the angularJs docs : https://docs.angularjs.org/api/ng/filter/date
What do you get if you remove the date filter ? Maybe the date property is not a date but a formatted string already.
Dave
The date is an Umbraco DatePicker.
Yeah, I saw the the angularJs docs before set the filter: https://docs.angularjs.org/api/ng/filter/date
If I remove the date filter, I have the same result:
So...the filter don't function properly, but I don't know why.
Hi Adrian,
It probably does noet work because the date field is not a javascript date object, but a formatted string.
So maybe you can try this :
Event: {{ eventTitle }} - {{ Date.parse(eventDate) | date : "dd/MM/yyyy" }}
Thank you but unfortunately your code return an empty value:
Event: 75° Festival di Cannes -
Did you ever find a solution to this?
Hi, sorry for delay.
Unfortunately I haven't found a solution yet
https://our.umbraco.com/forum/using-umbraco-and-getting-started/100308-nested-content-template
This is a good news...I'll try this solution
Thank you Adriano
Hi please look at here https://docs.angularjs.org/api/ng/filter/date. You must try this steps.
I am having the same troubles. Anybody have any other suggestions?
{{eventDate}}
outputs
"2024-03-13 00:00:00"
{{eventDate | date:"MM/dd/yyyy"}}
outputs "2024-03-13 00:00:00"
{{Date.parse(eventDate) | date:"MM/dd/yyyy"}}
outputs ""
{{eventDate | momentDateTimeZone:"MM/dd/yyyy"}}
throws an exception
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to format dates in blocklist labels
Hi to all, In Umbraco v8 I created a blocklist for events.
I would to show (as label) the title and date of a single event.
Title is ok, but the date not.
I set the "Label" field as follow:
The result, in content node, is:
But I expected it to be:
Can anyone help me to correctly format the label?
Thank you
Adriano
Hi Adriano,
That should be correct according to the angularJs docs : https://docs.angularjs.org/api/ng/filter/date
What do you get if you remove the date filter ? Maybe the date property is not a date but a formatted string already.
Dave
The date is an Umbraco DatePicker.
Yeah, I saw the the angularJs docs before set the filter: https://docs.angularjs.org/api/ng/filter/date
If I remove the date filter, I have the same result:
So...the filter don't function properly, but I don't know why.
Adriano
Hi Adrian,
It probably does noet work because the date field is not a javascript date object, but a formatted string.
So maybe you can try this :
Thank you but unfortunately your code return an empty value:
Adriano
Did you ever find a solution to this?
Hi, sorry for delay.
Unfortunately I haven't found a solution yet
https://our.umbraco.com/forum/using-umbraco-and-getting-started/100308-nested-content-template
This is a good news...I'll try this solution
Thank you Adriano
Hi please look at here https://docs.angularjs.org/api/ng/filter/date. You must try this steps.
I am having the same troubles. Anybody have any other suggestions?
outputs
"2024-03-13 00:00:00"
outputs "2024-03-13 00:00:00"
outputs ""
throws an exception
is working on a reply...