Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Should be allowed to pass options from format_date()
into getters for date type fields.
Should be allowed to pass options from format_date()
into getters for date type fields.
Comments
Comment #2
Derimagia CreditAttribution: Derimagia at Mindgrub Technologies commentedI like this a lot better than what it does currently. Right now it there's a getDate() function but if you have a field called field_date you can't use the value getter. It would be nice if there was an optional parameter to format it, or some sort.
Comment #3
zengenuity CreditAttribution: zengenuity at Zengenuity commentedWell, there are two issues in your comment:
First: We need some template files for date type fields. This is what this issue is about. There is already an example for date properties under templates/base_class/methods/date. If you'd like to write templates for the date type fields and submit a patch, those would go under templates/methods/date.
Second: If you have a field called field_date, you're right. It causes issues due to the method name conflict. I don't think we can do anything about that now, because I don't want to change the name of the getDate() function. People may be using it. But, definitely for the D8 version, we need to keep it in mind and come up with a different way to do it.
Comment #4
Derimagia CreditAttribution: Derimagia at Mindgrub Technologies commentedYeah, I agree about not switching for backwards compatibility unless we did a major version change (which wouldn't happen anytime soon since there isn't anything to add).