NLIDateField
The general structure of this component:
<nli-datefield [configs]="options"
label="Date"
[selectedDate]="date"></nli-datefield>
configs:
public options:any = {
currentDate:{year:new Date().getFullYear(), month:new Date().getMonth(), day:new Date().getDate()},
displayTime:false, //implemented not yet
displayTimeWithSeconds:false // implemented not yet
};
Setup Steps:
-
Add dependency in package.json under dependencies object:
"@sdtyn/nli-datefield": "0.0.1"
-
Run npm install in project folder (The home folder that package.json
exists):
npm install
This command downloads all dependencies including @sdtyn/nli-datefield. You can also download just this module with:
npm install @sdtyn/nli-datefield
-
Import input module to your project. In your main module (or module that you want use this component) that its default name is app.module.ts
, import it:
import { NLIDateFieldModule } from '@sdtyn/nli-datefield/datefield.module';
...
@NgModule({
...
imports: [
...
NLIDateFieldModule
]
...
});
Usage example:
<div style="width:100%; height:100%;">
<nli-datefield [configs]="options" label="Datum" [selectedDate]="tomorrow"></nli-datefield>