Skip to content

Commit

Permalink
switching to use intl v3
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart committed Dec 31, 2019
1 parent 7aec71a commit 0d4f54a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "brightspace/polymer-3-config",
"globals": {
"d2lIntl": true,
"fastdom": false
}
}
13 changes: 7 additions & 6 deletions d2l-date-picker-behavior.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@polymer/polymer/polymer-legacy.js';
import 'fastdom/fastdom.js';
import './localize-behavior.js';
import d2lIntl from 'd2l-intl';
import {getDateTimeDescriptor} from '@brightspace-ui/intl/lib/dateTime.js';
import { useShadow } from '@polymer/polymer/lib/utils/settings.js';
window.D2L = window.D2L || {};
window.D2L.PolymerBehaviors = window.D2L.PolymerBehaviors || {};
Expand Down Expand Up @@ -128,14 +128,15 @@ D2L.PolymerBehaviors.DatePicker.DatePickerBehaviorImpl = {
},

_updateDatePickeri18n: function() {
var locale = d2lIntl.LocaleProvider(this.locale);

var descriptor = getDateTimeDescriptor();

var datePicker = this.$$('vaadin-date-picker-light');
var localeOverrides = {
monthNames: locale.date.calendar.months.long,
weekdays: locale.date.calendar.days.long,
weekdaysShort: locale.date.calendar.days.short,
firstDayOfWeek: this.firstDayOfWeek ? this.firstDayOfWeek : locale.date.calendar.firstDayOfWeek,
monthNames: descriptor.calendar.months.long,
weekdays: descriptor.calendar.days.long,
weekdaysShort: descriptor.calendar.days.short,
firstDayOfWeek: this.firstDayOfWeek ? this.firstDayOfWeek : descriptor.calendar.firstDayOfWeek,
today: this.localize('today'),
cancel: this.localize('cancel'),
formatDate: function(date) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"version": "2.3.2",
"dependencies": {
"@brightspace-ui/intl": "Brightspace/intl#v3",
"@polymer/iron-a11y-keys": "^3.0.1",
"@polymer/iron-dropdown": "^3.0.1",
"@polymer/iron-input": "^3.0.1",
Expand Down

0 comments on commit 0d4f54a

Please sign in to comment.