How to change date format in date filter?

Discussão em 'Angular' iniciado por Arjun Kumar, Fevereiro 13, 2025.

  1. Arjun Kumar

    Arjun Kumar Guest

    In my Angular frontend I am using agDateColumnFilter for Date filter. When I change the user locale my code logic translates the column value in respective locale's date format, but the date format of Date picker is always dd-mm-yyyy, Like in Canadian French the date format is yyyy-mm-dd but the filter shows selected date in dd-mm-yyyy.

    How can i configure the locale's date format in date picker code -

    private logsColDef(): ColDef[] {
    return [
    {
    headerName: this.translate.instant('loguploadtime_name_label'),
    field: 'uploadTime',
    colId: 'uploadTime',
    type: ['Date', 'DateISO'],
    tooltipField: '',
    filter: 'agDateColumnFilter',
    },


    I tried to looking for way to change date format of Date picker but found that it uses date format as per browser's locale. When i changes the language of browser then i do see changes in date format of date picker,

    But i expect that without changing browser's language, the date picker should use the date format which i provide from the user's locale policy. How can

    Continue reading...

Compartilhe esta Página