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

feat(date/time-picker): add possibility to set offsets #4731

Open
juicyarts opened this issue Oct 24, 2018 · 0 comments
Open

feat(date/time-picker): add possibility to set offsets #4731

juicyarts opened this issue Oct 24, 2018 · 0 comments

Comments

@juicyarts
Copy link

Bug description or feature request:

I searched for this kind of issues but couldn't find anything that is comparable to our use-case and proposal.

use case:

We use the date and time-pickers of ngx-bootstrap in an application that needs to show all date and time values in a specific timezone. Given some companies that a user has access to, the date and time values shown in the application should all refer to the timezone the selected company is operating in no matter where the user/client is located.

I started implementing this in a fork since we definitely need this but if you also see this as a useful feature it would be nice to implement it into ngx-bootstrap.

proposal

A new property called offset is made available

...
@Input() offset: number; // time offset in minutes, can be negative
...
<timepicker [(ngModel)]="mytime" [offset]="offset"></timepicker>
<datepicker [(ngModel)]="mytime" [offset]="offset"></datepicker>

This adds or subtracts given offset to the "displayed" values and also takes them into account when working with min and max properties. The date object itself is not being modified since this is all about the display format.

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 3.1.0

Angular: 6.1.6

Bootstrap: 4

Build system: Angular CLI, System.js, webpack, starter seed:

CLI

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

Successfully merging a pull request may close this issue.

3 participants