Skip to content

Commit

Permalink
(0.2.3) - Including TimezonePickerService in module
Browse files Browse the repository at this point in the history
+ Fixing errors in README
  • Loading branch information
Samuel Nygaard committed Jan 27, 2018
1 parent 11962ce commit c1c10e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
11 changes: 6 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A simple Angular module to create a timezone selector using [moment-timezones](h

## [Demo](https://samuelnygaard.github.io/ng2-timezone-selector/) | [Documentation](https://samuelnygaard.github.io/ng2-timezone-selector/docs/)

## New features (0.2.2)
## New features (0.2.3)

* Guess the timezone based on browser settings, usage:
* `<ng2-timezone-picker [(timezone)]="timezone" guess="true"></ng2-timezone-picker>`
Expand All @@ -25,11 +25,11 @@ $ npm install ng2-timezone-selector --save

The library depent on [jQuery](https://github.com/jquery/jquery) and [select2](https://github.com/select2/select2) and [moment-timezone](https://github.com/moment/moment-timezone)

The only file required is the select2 `css` file:
The only file required is the select2 `select2.min.css` file:

#### 1. Method (should work for all)

Include the css file in the `angular-cli.json` file (remember to re-run `ng serve`, after editing `angular-cli.json`):
Include the `select2.min.css` file in the `angular-cli.json` file (remember to re-run `ng serve`, after editing `angular-cli.json`):

```json
{
Expand All @@ -39,8 +39,9 @@ Include the css file in the `angular-cli.json` file (remember to re-run `ng serv
"apps": [
{
...
"scripts": [
"../node_modules/select2/dist/js/select2.min.js"
"styles": [
"styles.scss",
"../node_modules/select2/dist/css/select2.min.css"
],
...
}
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export * from './timezone-picker.service';
@NgModule({
imports: [CommonModule],
declarations: [TimezonePickerComponent, TimezonePickerPipe],
providers: [TimezonePickerService],
exports: [TimezonePickerComponent, TimezonePickerPipe]
})
export class TimezonePickerModule {
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-timezone-selector",
"version": "0.2.2",
"version": "0.2.3",
"description":
"A simple Angular module to create a timezone selector using moment-timezone",
"repository": {
Expand Down
4 changes: 1 addition & 3 deletions src/timezone-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ import 'select2';
<span *ngIf="showOffset">{{offsetOfTimezone(c.zones[0])}}</span>
</option>
</ng-template>
</select>
`,
viewProviders: [TimezonePickerService]
</select>`
})
export class TimezonePickerComponent implements AfterViewInit {
/**
Expand Down

0 comments on commit c1c10e3

Please sign in to comment.