Skip to content

Add null/not null filters and fix the date picker#4

Open
sitharus wants to merge 5 commits intomasterfrom
fix-datepicker
Open

Add null/not null filters and fix the date picker#4
sitharus wants to merge 5 commits intomasterfrom
fix-datepicker

Conversation

@sitharus
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Contributor

@dwat001 dwat001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have experience with grid.mvc so don't feel I should approve this change, but I have found some things worth commenting on.

Did the line endings of these files change? Github was doing a poor job of showing what was different.

This PR would of been easier to process if it was split into multiple commits.

Comment thread GridMvc.Site/Scripts/gridmvc.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we either raygun this exception or check it is the expected exception and rethrow if it not the expected exception

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't Raygun from Grid.MVC as that'd add a dependency to it. I can delete this handler now the underlying format is fixed.

Comment thread GridMvc.Site/Scripts/gridmvc.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little bit of a shame to go from an unambiguous default to an ambiguous one.
10-11-12 could be a lot of dates 2010-11-12 is the 12th of november

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jQuery is special. yy-mm-dd is 2010-11-12. yyyy-mm-dd is 20102010-11-12.

Comment thread GridMvc.Site/Scripts/gridmvc.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want some validation that type is one of the date comparisons here? Or are we confident that onSelect will only fire when it is?

Comment thread GridMvc.Site/Scripts/gridmvc.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.parseDate(datePickerOptions.format || "yy-mm-dd") ?

Comment thread GridMvc.Site/Scripts/gridmvc.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this block be removed from the try catch?

var date = null;
try{parse}catch(e){}
if(date) {...}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it worth doing formatting changes to a fork of a project? it will make taking updates from the upstream project harder. (I don't know how wide ranging our changes are).

Comment thread GridMvc/Filtering/GridFilterType.cs Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mix of tabs and spaces, could we please keep this consistant within a file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mix of space and tabs means code does not align.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Personal Preference] I prefer string[] over var as it makes it easier to determine the type of data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of var here means I don't know what types these are in code review. I love var as the left side of new statments, initilization of primitives, toString methods etc. ; but find it reduces the readability of most method calls

@sitharus
Copy link
Copy Markdown
Author

Didn't notice the whitespace changes, we default to tabs but grid.mvc is all spaces. I'll fix it up when I have time.

Phillip Hutchings added 4 commits January 16, 2017 10:27
Currently it cannot be changed after the initial value is set.

This is because jQuery UI changed the event name and altered the dateParse code so
that yyyy-mm-dd becomes 20102010-01-31 but yy-mm-dd is 2010-01-31
@sitharus
Copy link
Copy Markdown
Author

@dwat001 I've addressed your comments, it should be easier to digest now. I dumped it all up in a hurry before moving house.

@leafgarland
Copy link
Copy Markdown

https://pushpay.atlassian.net/browse/PP-10280 needs this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants