Geeksltd / Olive

Olive framework, for more productive cross platform .NET solutions. It's available under the GPL v3 license. See License.md for more information.
https://geeksltd.github.io/Olive
Other
44 stars 44 forks source link

FooterFormula(AggregateFormula.Count) on date property not working as expected #130

Closed ChadOGeeks closed 4 years ago

ChadOGeeks commented 5 years ago

When we make a change to a list module to include a footer row and then define a footer formula on a datetime property - if the FooterFormula is specified as AggregateFormula.Count, a date time format is displayed instead of the count of items of this property in the list.

FooterFormula(AggregateFormula.Count) on a date property incorrectly assumes the result should be displayed in a date format instead of just a number.

eg: Column(x => x.SomeDateField).FooterFormula(AggregateFormula.Count)

Generates the following in the footer in the view: "{0:yyyy-MM-dd @ hh:mm tt}".FormatWith(Model.Items.Count(d => "{0}".FormatWith(d.Item.SomeDateField) .HasValue()))

Where it should have generated: "{0}".FormatWith(Model.Items.Count(d => "{0}".FormatWith(d.Item.SomeDateField) .HasValue()))

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.