Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
feat(boosted): update boosted & ng-bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
BehnooshShiva committed Jul 7, 2021
1 parent f6cac07 commit 9d2c667
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 55 deletions.
4 changes: 0 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
"src/assets"
],
"styles": [
"node_modules/boosted/dist/css/orangeHelvetica.css",
"node_modules/boosted/dist/css/orangeIcons.css",
"node_modules/boosted/scss/boosted.scss",
"dist/ng-boosted/style/ng-boosted.scss",
"src/styles.scss"
Expand Down Expand Up @@ -101,8 +99,6 @@
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"node_modules/boosted/dist/css/orangeHelvetica.css",
"node_modules/boosted/dist/css/orangeIcons.css",
"node_modules/boosted/scss/boosted.scss",
"dist/ng-boosted/style/ng-boosted.scss",
"src/styles.scss"
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"@angular/platform-browser": "~12.1.1",
"@angular/platform-browser-dynamic": "~12.1.1",
"@angular/router": "~12.1.1",
"@ng-bootstrap/ng-bootstrap": "^9.1.1",
"@ng-bootstrap/ng-bootstrap": "^11.0.0-beta.2",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^14.6.4",
"acorn": "^8.0.1",
"boosted": "^4.6.0",
"boosted": "^5.0.0",
"classlist.js": "^1.1.20150312",
"codelyzer": "^6.0.0",
"core-js": "^2.5.4",
Expand Down
46 changes: 23 additions & 23 deletions src/app/demos/datepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ const I18N_VALUES = {
}

// Define custom service providing the months and weekdays translations
@Injectable()
export class CustomDatepickerI18n extends NgbDatepickerI18n {
constructor(private _i18n: I18n) {
super();
}
public getWeekdayShortName(weekday: number): string {
return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
}
public getMonthShortName(month: number): string {
return I18N_VALUES[this._i18n.language].months[month - 1];
}
public getMonthFullName(month: number): string {
return this.getMonthShortName(month);
}
public getDayAriaLabel(date: NgbDateStruct): string {
const newDate = new Date(date.year, date.month - 1, date.day);
let newDay = newDate.getDay();
newDay = newDay === 0 ? 7 : newDay;
const day = this.getWeekdayShortName(newDay);
return day + ' ' + `${date.day}-${date.month}-${date.year}`;
}
}
// @Injectable()
// export class CustomDatepickerI18n extends NgbDatepickerI18n {
// constructor(private _i18n: I18n) {
// super();
// }
// public getWeekdayShortName(weekday: number): string {
// return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
// }
// public getMonthShortName(month: number): string {
// return I18N_VALUES[this._i18n.language].months[month - 1];
// }
// public getMonthFullName(month: number): string {
// return this.getMonthShortName(month);
// }
// public getDayAriaLabel(date: NgbDateStruct): string {
// const newDate = new Date(date.year, date.month - 1, date.day);
// let newDay = newDate.getDay();
// newDay = newDay === 0 ? 7 : newDay;
// const day = this.getWeekdayShortName(newDay);
// return day + ' ' + `${date.day}-${date.month}-${date.year}`;
// }
// }

@Component({
selector: 'demo-datepicker',
templateUrl: './datepicker.component.html',
styleUrls: ['./datepicker.component.scss'],
providers: [I18n, {provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n}]
providers: [I18n]
})
export class DemoDatepickerComponent {
public model1;
Expand Down
38 changes: 19 additions & 19 deletions src/app/demos/o-calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,32 @@ const I18N_VALUES = {
}

// Define custom service providing the months and weekdays translations
@Injectable()
export class CustomDatepickerI18n extends NgbDatepickerI18n {
// @Injectable()
// export class CustomDatepickerI18n extends NgbDatepickerI18n {

constructor(private _i18n: I18n) {
super();
}
// constructor(private _i18n: I18n) {
// super();
// }

public getWeekdayShortName(weekday: number): string {
return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
}
public getMonthShortName(month: number): string {
return I18N_VALUES[this._i18n.language].months[month - 1];
}
public getMonthFullName(month: number): string {
return this.getMonthShortName(month);
}
public getDayAriaLabel(date: NgbDateStruct): string {
return `${date.day}-${date.month}-${date.year}`;
}
}
// public getWeekdayShortName(weekday: number): string {
// return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
// }
// public getMonthShortName(month: number): string {
// return I18N_VALUES[this._i18n.language].months[month - 1];
// }
// public getMonthFullName(month: number): string {
// return this.getMonthShortName(month);
// }
// public getDayAriaLabel(date: NgbDateStruct): string {
// return `${date.day}-${date.month}-${date.year}`;
// }
// }

@Component({
selector: 'demo-o-calendar',
styles: [],
templateUrl: './o-calendar.component.html',
providers: [I18n, {provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n}]
providers: [I18n]
})
export class DemoOCalendarComponent {
public model: NgbDateStruct;
Expand Down

0 comments on commit 9d2c667

Please sign in to comment.