diff --git a/demo/src/app/components/+datepicker/demos/bs-popup/date-picker-popup.html b/demo/src/app/components/+datepicker/demos/bs-popup/date-picker-popup.html
index 67672383b4..c6355b9d94 100644
--- a/demo/src/app/components/+datepicker/demos/bs-popup/date-picker-popup.html
+++ b/demo/src/app/components/+datepicker/demos/bs-popup/date-picker-popup.html
@@ -15,7 +15,7 @@
{{bsRangeValue}}-
{{ bsRangeValue[0] | date:'yMd'}} - {{ bsRangeValue[1] | date:'yMd'}}+
{{ bsRangeValue[0] | date:'yMd'}} - {{ bsRangeValue[1] | date:'yMd'}}diff --git a/package.json b/package.json index 55413a3855..16bcca8f76 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "demo.serve": "run-s build link demo.docs demo.build docs.archive lite-server", "demo.serve-fast": "run-s build link demo.docs demo.build-fast docs.archive lite-server", "demo.gh-pages": "run-s build demo.docs demo.build docs.archive demo.deploy", - "demo.build": "ng build -prod --aot --build-optimizer --preserve-symlinks -nc", + "demo.build": "ng build -prod --aot --preserve-symlinks -nc", "demo.build-fast": "ng build", "demo.deploy": "gh-pages -d gh-pages", "demo-beta-deploy": "gh-pages -d gh-pages -r git@github.com:valorkin/ngx-bootstrap.git -b gh-pages", diff --git a/src/datepicker/bs-daterangepicker-input.directive.ts b/src/datepicker/bs-daterangepicker-input.directive.ts index 6e241015c1..7c2fc0f8f0 100644 --- a/src/datepicker/bs-daterangepicker-input.directive.ts +++ b/src/datepicker/bs-daterangepicker-input.directive.ts @@ -37,13 +37,13 @@ export class BsDaterangepickerInputDirective v[0], this._picker._config.rangeInputFormat, this._picker._config.locale - ); + ) || ''; const end = formatDate( v[1], this._picker._config.rangeInputFormat, this._picker._config.locale - ); - range = start + this._picker._config.rangeSeparator + end; + ) || ''; + range = (start && end) ? start + this._picker._config.rangeSeparator + end : ''; } this._renderer.setProperty(this._elRef.nativeElement, 'value', range); this._onChange(v); @@ -58,6 +58,7 @@ export class BsDaterangepickerInputDirective writeValue(value: Date[] | string) { if (!value) { this._picker.bsValue = null; + return; } const _locale = getLocale(this._picker._config.locale);