Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
ngx-bootstrap datepicker value disappear or remove itself

I'm using ngx-boostrap datepicker and i have two datepickers as below

<div class="form-group col-sm-2">
  <input type="text" id="dvcStart" class="form-control  form-control-sm" #dp="bsDatepicker" bsDatepicker
    [(bsValue)]="dvcStartDateValueStr" [(ngModel)]="dvcStartDateValue" 
    [bsConfig]="{ dateInputFormat: 'YYYY-MM-DD' ,containerClass:'theme-dark-blue' }">
</div>
<div class="form-group col-sm-2">
  <input type="text" id="dvcEnd" class="form-control  form-control-sm" #dp="bsDatepicker" bsDatepicker
    [(bsValue)]="dvcEndDateValueStr" [(ngModel)]="dvcEndDateValue" 
    [bsConfig]="{ dateInputFormat: 'YYYY-MM-DD',containerClass:'theme-dark-blue' }">
</div>

First datepicker working perfectly as expected but second one changing value itself for example page initial normally with expected values but when i click one of button or trigger one event without connection with datepicker, second datepicker value disappear and removing value itself. This is how i fill my datepickers in typescript side

  public dvcEndDateValue: Date;
  public dvcStartDateValue: Date;
  ngOnInit() {
     this.dvcStartDateValue = getFirstDayOfMonth();
     this.dvcEndDateValue = new Date();
  }

What is causing this problem? Any ideas?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!