You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] Are multiple formatters for the same type supported in some way? #423
A example scenario would be a class that has 2 different DateTime properties where one should be rendered using the date and time and one should be rendered only using the date. Is there some way to tell handlebars to use a different formatter for each property?
Explicitly define format in the template using helper
Implement IObjectDescriptorProvider and IMemberAccessor for your type and return already formatted string for those properties.
An advanced variation of this would be to implement a generic wrapper that would know how to format containing value as well as accessing its properties.
Unfortunately defining custom format on property declaration (via attribute) is not supported and assuming current design it is complicated to implement something like this.
Activity
oformaniuk commentedon Feb 1, 2021
Hello @Sacrilege,
There's basically two options:
An advanced variation of this would be to implement a generic wrapper that would know how to format containing value as well as accessing its properties.
Unfortunately defining custom format on property declaration (via attribute) is not supported and assuming current design it is complicated to implement something like this.