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

Commit 70467da

Browse files
committed
fix(calendar): fix incorrect angular.bind use
1 parent bb99d5c commit 70467da

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/components/datepicker/dateLocaleProvider.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
(function() {
22
'use strict';
33

4-
/**
5-
* Provider that allows the user to specify messages, formatters, and parsers for date
6-
* internationalization.
7-
*/
8-
9-
104
/**
115
* @ngdoc service
126
* @name $mdDateLocaleProvider
@@ -30,17 +24,21 @@
3024
* $mdDateLocaleProvider.dates = [1, 2, 3, 4, 5, 6, ...];
3125
*
3226
* // Example uses moment.js to parse and format dates.
33-
* $mdDateLocaleProvider.formatDate = function(date) {
34-
* return moment(date).format
35-
* };
3627
* $mdDateLocaleProvider.parseDate = function(dateString) {
37-
* return moment(dateString).toDate('L');
28+
* return moment(dateString).toDate();
29+
* };
30+
*
31+
* $mdDateLocaleProvider.formatDate = function(date) {
32+
* return moment(date).format('L');
3833
* };
3934
*
4035
* $mdDateLocaleProvider.monthHeaderFormatter = function(date) {
41-
* $mdDateLocale.shortMonths[date.getMonth()] + ' ' + date.getFullYear();
36+
* myShortMonths[date.getMonth()] + ' ' + date.getFullYear();
4237
* };
4338
*
39+
* // In addition to date display, date components also need localized messages
40+
* // for aria-labels for screen-reader users.
41+
*
4442
* $mdDateLocaleProvider.weekNumberFormatter = function(weekNumber) {
4543
* return 'Semaine ' + weekNumber;
4644
* };

src/components/datepicker/datePicker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @usage
3636
* <hljs lang="html">
37-
* <md-date-picker ng-model="birthday"></md-date-picker>
37+
* <md-datepicker ng-model="birthday"></md-datepicker>
3838
* </hljs>
3939
*
4040
*/
@@ -87,7 +87,7 @@
8787
var EXTRA_INPUT_SIZE = 3;
8888

8989
/**
90-
* Controller for md-date-picker.
90+
* Controller for md-datepicker.
9191
*
9292
* @ngInject @constructor
9393
*/
@@ -251,7 +251,7 @@
251251
// This avoids two bindings (outer scope to ctrl, ctrl to input).
252252
Object.defineProperty(this.$element[0], 'disabled', {
253253
get: function() { return self.isDisabled; },
254-
set: angular.bind(self.setDisabled, self)
254+
set: angular.bind(self, self.setDisabled)
255255
});
256256

257257
Object.defineProperty(this, 'placeholder', {

0 commit comments

Comments
 (0)