Should be allowed to pass options from format_date() into getters for date type fields.

Comments

  • zengenuity committed 3509387 on 7.x-1.x
    #2364433, #2364489 - Text fields default to plain text or their stored...
Derimagia’s picture

I 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.

zengenuity’s picture

Well, 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.

Derimagia’s picture

Yeah, 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).