Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

How to display WeekNumbers in md-datepicker? #10003

@tahaerden

Description

@tahaerden

I'm using the following config:

app.config(function($mdDateLocaleProvider) {
    // Can change week display to start on Monday.
    $mdDateLocaleProvider.firstDayOfWeek = 1;

    $mdDateLocaleProvider.parseDate = function(dateString) {
      var m = moment(dateString, 'DD.MM.YYYY', true);
      return m.isValid() ? m.toDate() : new Date(NaN);
    };

    $mdDateLocaleProvider.formatDate = function(date) {
      return moment(date).format('DD.MM.YYYY');
    };

    $mdDateLocaleProvider.weekNumberFormatter = function(weekNumber) {
      return 'Week' + weekNumber;
    };
  });

And here is my datepicker:

 <md-input-container>
                  <md-datepicker name="startDate" ng-model="startDate" placeholder="{{'startDate' | translate}}"  required></md-datepicker>
                  <div class="help-block" ng-messages="startDate.$error">
                    <div ng-messages-include="/components/error-messages.html"></div>
                  </div>
 </md-input-container>

Now I can see the weekNumber variable is working on my console. But how can I display it inside the calendar? I couldn't find an option for this on the doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5: nice to haveThese issues will not be fixed without community contributions.resolution: not coreThese issues do not directly align with the core goals of the project.type: enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions