Skip to content

Commit

Permalink
Merge pull request #579 from udos86/development
Browse files Browse the repository at this point in the history
min, max, focusedDate support for NG Bootstrap DatePicker (closes #57
  • Loading branch information
udos86 committed Nov 11, 2017
2 parents d290bef + 7ba4c54 commit 27f6e4b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 5.0.2

### **Features**

* `min`, `max` and `focusedDate` support for `DynamicDatePickerModel` in `ui-ng-bootsrap` (closes [#570](https://github.com/udos86/ng-dynamic-forms/issues/570), [#576](https://github.com/udos86/ng-dynamic-forms/issues/576))

***

# 5.0.1

### **Features**
Expand Down
10 changes: 7 additions & 3 deletions packages/core/src/model/datepicker/dynamic-datepicker.model.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { DynamicFormControlClsConfig } from "../dynamic-form-control.model";
import { serializable } from "../../decorator/serializable.decorator";
import { DynamicDateControlModel, DynamicDateControlModelConfig } from "../dynamic-date-control.model";
import {
DynamicDateControlModel,
DynamicDateControlModelConfig,
DynamicDateControlValue
} from "../dynamic-date-control.model";

export const DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER = "DATEPICKER";

export interface DynamicDatePickerModelConfig extends DynamicDateControlModelConfig {

focusedDate?: string | Date;
focusedDate?: DynamicDateControlValue;
inline?: boolean;
toggleIcon?: string;
}

export class DynamicDatePickerModel extends DynamicDateControlModel {

@serializable() focusedDate: string | Date | null;
@serializable() focusedDate: DynamicDateControlValue;
@serializable() inline: boolean;
@serializable() toggleIcon: string | null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@
[class.is-invalid]="showErrorMessages"
[dynamicId]="bindId && model.id"
[formControlName]="model.id"
[maxDate]="model.max"
[minDate]="model.min"
[name]="model.name"
[ngClass]="model.cls.element.control"
[placeholder]="model.placeholder">
[placeholder]="model.placeholder"
[startDate]="model.focusedDate">

<div class="input-group-addon" (click)="datepicker.toggle()">
<img [src]="model.toggleIcon" style="cursor: pointer;"/>
Expand Down

0 comments on commit 27f6e4b

Please sign in to comment.