Skip to content

Commit

Permalink
feat(demo): pick datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
HitkoDev committed Mar 6, 2023
1 parent 40f632e commit b732940
Show file tree
Hide file tree
Showing 11 changed files with 721 additions and 30 deletions.
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
}
],
"styles": [
"packages/demo/src/styles.scss"
"packages/demo/src/styles.scss",
"dist/nxt-pick-datetime/assets/picker.scss"
],
"scripts": []
},
Expand Down
4 changes: 4 additions & 0 deletions packages/demo/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const routes: Routes = [
{
path: 'json-view',
loadChildren: () => import('./json-view/json-view.module').then(m => m.AppJsonViewModule)
},
{
path: 'pick-datetime',
loadChildren: () => import('./pick-datetime/pick-datetime.module').then(m => m.AppPickDatetimeModule)
}
]

Expand Down
2 changes: 2 additions & 0 deletions packages/demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { AppRoutingModule } from './app-routing.module'
import { AppComponent } from './app.component'

Expand All @@ -9,6 +10,7 @@ import { AppComponent } from './app.component'
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule
],
providers: [],
Expand Down
23 changes: 0 additions & 23 deletions packages/demo/src/app/pick-datetime/app.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { AppPickDatetimeComponent } from './pick-datetime.component'

const routes: Routes = [
{ path: '', component: AppPickDatetimeComponent }
]

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class AppPickDatetimeRoutingModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { AfterViewInit, Component, ViewChild } from '@angular/core'
import { OwlDateTimeComponent } from 'nxt-pick-datetime'

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
selector: 'app-pick-datetime',
templateUrl: './pick-datetime.component.html',
styleUrls: ['./pick-datetime.component.scss']
})
export class AppComponent implements AfterViewInit {
export class AppPickDatetimeComponent implements AfterViewInit {
@ViewChild('date_range_component', { static: true })
date_range_component?: OwlDateTimeComponent<AppComponent>
date_range_component?: OwlDateTimeComponent<AppPickDatetimeComponent>

public selectedMoments: Date[] = [
new Date('2019-03-11T08:00:00+11:00'),
Expand Down
23 changes: 23 additions & 0 deletions packages/demo/src/app/pick-datetime/pick-datetime.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CommonModule } from '@angular/common'
import { NgModule } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { OwlDateTimeModule } from 'nxt-pick-datetime'
import { OwlNativeDateTimeModule } from 'nxt-pick-datetime/native-adapter'
import { AppPickDatetimeRoutingModule } from './pick-datetime-routing.module'
import { AppPickDatetimeComponent } from './pick-datetime.component'

@NgModule({
declarations: [
AppPickDatetimeComponent
],
imports: [
CommonModule,
FormsModule,
OwlDateTimeModule,
OwlNativeDateTimeModule,
AppPickDatetimeRoutingModule
],
providers: [],
bootstrap: [AppPickDatetimeComponent]
})
export class AppPickDatetimeModule { }
4 changes: 4 additions & 0 deletions packages/demo/src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
Expand Down
Loading

0 comments on commit b732940

Please sign in to comment.