angular-advanced-searchbox icon indicating copy to clipboard operation
angular-advanced-searchbox copied to clipboard

Is there any implementation for date properties?

Open jaredmahan opened this issue 9 years ago • 9 comments

It would be extremely helpful to be able to search by date properties via datetimepicker. Is this functionality already available?

jaredmahan avatar Feb 05 '16 15:02 jaredmahan

Hi, this was also requested in #19 and is on my todo list.

Does the HTML 5 datetime picker work for your or do you need a plugin for older browsers?

dnauck avatar Feb 06 '16 09:02 dnauck

When type="date" is supplied along with seacrhParameters, it displays the calendar. But, the issue is, if you click on down arrow in the text box that usually comes in date type input field, it trigger ng-blur event (this happens only first time and after that it behaves normally). This ng-blur event hides the calendar since it resets edit property from that particular element. Anyone elese faced this issue? image

vaibhavgarg90 avatar May 31 '16 09:05 vaibhavgarg90

Hi,

thats the current and very annoying problem with ng-blur. Thats why this feature is not official. I've currently no good idea how to solve this.

dnauck avatar May 31 '16 09:05 dnauck

One hack can be to keep a counter and check if input type is date and counter is 0, then don't make searchParam.editMode = false in $scope.leaveEditMode(). After that, it should be fine.

vaibhavgarg90 avatar May 31 '16 09:05 vaibhavgarg90

Hey, I was casually going through the code. I think this issue might be due to nitSetFocus directive. The problem is that, when you click to add any search parameter, the focus on that element is set in nitSetFocus directive. But after that, due to some reason focus is lost. This issue is coming on any type of HTML element. For example, if you add any text parameter, and instead of directly typing in the text box, you click inside the text box, the search parameter will get removed and you will have to select it again from list of available parameters. Even if this is expected behavior, would it be possible to not lose the focus on element when one clicks on the input element, so that date type can be added in search param.

vaibhavgarg90 avatar Jun 10 '16 07:06 vaibhavgarg90

Update. I was able to fix this issue by re-entering edit mode on click event inside the input element. ng-click="enterEditMode($event, $index)" Can you please verify that will fix this issue?

vaibhavgarg90 avatar Jun 10 '16 07:06 vaibhavgarg90

Hey @gargvaibhav90,

this is just a "hack" ;) .. The real problem is the ng-blur to leave the edit mode. The blur event is not very useful for that but i've currently no clue what else.

dnauck avatar Jun 14 '16 05:06 dnauck

@dnauck, @gargvaibhav90 is there a downside to using the hack above as a stopgap solution to the ng-blur problems?

johnmccabe avatar Jul 20 '16 10:07 johnmccabe

@gargvaibhav90 I had the same issue and i fixed with ng-click="enterEditMode($event, $index)" on input as you said.

josearubio avatar Apr 07 '17 07:04 josearubio