Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nb-date-timepicker component: Timepicker part of the component doesn't adhere to the set locale #2632

Closed
1 of 2 tasks
mtoksen opened this issue Dec 22, 2020 · 2 comments · Fixed by #2719
Closed
1 of 2 tasks

Comments

@mtoksen
Copy link

mtoksen commented Dec 22, 2020

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior:

When using the nb-date-timepicker, the timepicker part of the component doesn't adhere to the set locale. The "now" button and the abbreviations for "hour" ("Hr"), "minute" ("Min") and "second" ("Sec") are always in English.

The datepicker part works fine.

Expected behavior:

The nb-date-timepicker component adheres to the set locale, both the datepicker part and the timepicker part of the component.

Steps to reproduce:

  1. Set the locale to any other locale than 'en' (English).
  2. Use the nb-date-timepicker component on any page.
  3. When opened, the datepicker part uses the correct locale, but the timepicker part doesn't.

Related code:

See this stackblitz

Other information:

npm, node, OS, Browser

OS: Windows 10 64bit
Browser: Tested in Chrome/Firefox/Edge

Angular, Nebular

{
  "name": "gqairxmwm.github",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "@angular-devkit/build-angular": "0.1001.5",
    "@angular/animations": "10.1.5",
    "@angular/cdk": "10.2.4",
    "@angular/common": "10.1.5",
    "@angular/compiler": "10.1.5",
    "@angular/compiler-cli": "^10.0.0",
    "@angular/core": "10.1.5",
    "@angular/forms": "10.1.5",
    "@angular/localize": "^10.0.0",
    "@angular/platform-browser": "10.1.5",
    "@angular/platform-browser-dynamic": "10.1.5",
    "@angular/router": "10.1.5",
    "@nebular/eva-icons": "6.2.1",
    "@nebular/theme": "6.2.1",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "@types/jasmine": "2.8.17",
    "@types/jasminewd2": "2.0.8",
    "@types/node": "12.12.64",
    "eva-icons": "1.1.3",
    "ng-packagr": "^10.0.0",
    "rxjs": "6.6.3",
    "tslib": "2.0.2",
    "typescript": ">=3.9 < 4.1",
    "zone.js": "0.10.3"
  },
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.901.1",
    "@angular/cli": "~9.1.1",
    "@angular/compiler-cli": "~9.1.1",
    "@angular/language-service": "~9.1.1",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3"
  }
}
@JBetts97
Copy link

Hi @mtoksen,

It appears that the heading labels for "Hr", "Min", "Sec" are hardcoded at lines 149 - 151 in file: /src/framework/theme/components/timepickers/timepicker.component.ts

@Input() hoursText = 'Hr';
@Input() minutesText = 'Min';
@Input() secondsText = 'Sec';

I'm having difficulty setting up my local environment to test making changes, but I hope this information helps anybody else looking to resolve this issue!

@mtoksen
Copy link
Author

mtoksen commented Feb 9, 2021

Hi @mtoksen,

It appears that the heading labels for "Hr", "Min", "Sec" are hardcoded at lines 149 - 151 in file: /src/framework/theme/components/timepickers/timepicker.component.ts

@Input() hoursText = 'Hr';
@Input() minutesText = 'Min';
@Input() secondsText = 'Sec';

I'm having difficulty setting up my local environment to test making changes, but I hope this information helps anybody else looking to resolve this issue!

Hi @JBetts97,

Sorry for the late reply!

I figured they was hardcoded values somewhere, I just didn't have time to search for them. They doesn't look too hard to make configurable, though, since they're already inputs in the Timepicker component.
If I get the time to fix them, I will do so and make a PR so we can get them configurable in a future version of Nebular :)

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants