Prevent BsDateRangePicker showing future months

Discussão em 'Angular' iniciado por xaan, Abril 29, 2025.

  1. xaan

    xaan Guest

    In my BsDaterange picker, I want to achieve future dates disabled,

    although I am doing it correctly, when I click the current day it jumps into the future month, which is not a good practice,

    To refactor:- please click on today current Date, it should not jump to a future month,

    <input type="text"
    placeholder="Daterangepicker"
    class="form-control"
    bsDaterangepicker
    [bsConfig]="{ showPreviousMonth: true }"
    [maxDate]="maxDate"
    >


    .ts

    maxDate = new Date();


    Working Demo -- Stackblitz

    https://stackblitz.com/edit/angular-cxy5xw?file=app/show-previous-month.html

    Continue reading...

Compartilhe esta Página