1

I am using angular-bootstrap-datetimepicker.

On clicking on date picker for selection of date & time.

The current state is removing from browser URL. How to resolve this?

HTML code

<div class="dropdown">
    <a class="dropdown-toggle" id="startDate" role="button" data-toggle="dropdown" data-target="#" href="#">
        <div class="input-group">
            <input placeholder="{{'START_DATE' | translate}} *" required type="text" class="form-control" data-ng-model="startDate"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
        </div>
    </a>
    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
        <datetimepicker data-on-set-time="onStartDateSet(newDate, oldDate)" date-disabled="disableViewFields" data-ng-model="startDate" data-datetimepicker-config="{ dropdownSelector: '#startDate', startView:'day', minView:'hour' }" />
    </ul>
</div>
5
  • Can you show us the code of the controller and the HTML of the page? Commented Aug 25, 2015 at 9:54
  • Are you absolutely sure you're not hitting the <a> above the datepicker when you set a date with it? Try removing the <a> and see what happens Commented Aug 25, 2015 at 9:59
  • 2
    Only <a> tag - can I remove? Inside html too? Commented Aug 25, 2015 at 10:01
  • Yes, remove the whole <a class="dropdown-toggle" id="startDate" role="button" data-toggle="dropdown" data-target="#" href="#"> <div class="input-group"> <input placeholder="{{'START_DATE' | translate}} *" required type="text" class="form-control" data-ng-model="startDate"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> </div> </a> from HTML and see what happens Commented Aug 25, 2015 at 10:03
  • 2
    Date picker not showing, its hided, if I remove <a> tag section Commented Aug 25, 2015 at 10:09

1 Answer 1

2

If I removed href='#' from a tag, working fine. Code follows

<div class="dropdown">
<a class="dropdown-toggle" id="startDate" role="button" data-toggle="dropdown" data-target="#">
    <div class="input-group">
        <input placeholder="{{'START_DATE' | translate}} *" required type="text" class="form-control" data-ng-model="startDate"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
    </div>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    <datetimepicker data-on-set-time="onStartDateSet(newDate, oldDate)" date-disabled="disableViewFields" data-ng-model="startDate" data-datetimepicker-config="{ dropdownSelector: '#startDate', startView:'day', minView:'hour' }" />
</ul>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.