|
72037 | 72037 | this.showWeekNumbers = false;
|
72038 | 72038 | this.showTodayShortcut = false;
|
72039 | 72039 | this.showAmPm = false;
|
72040 |
| - this.useUtc = false; |
72041 |
| - this.currToday = false; |
| 72040 | + this.useUtc = false; /* check directive */ |
| 72041 | + this.currToday = false; /* check directive */ |
72042 | 72042 | this.selected$ = new core_1.EventEmitter();
|
72043 | 72043 | this.closing$ = new core_1.EventEmitter();
|
72044 | 72044 | this.locale = datetime_1.NguiDatetime.locale;
|
|
72149 | 72149 | }
|
72150 | 72150 | if (this.currToday) {
|
72151 | 72151 | if (this.useUtc) {
|
72152 |
| - this.selectDateTime(moment.tz('UTC').toDate()); |
| 72152 | + var d = new Date(); |
| 72153 | + this.selectDateTime(new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate())); |
72153 | 72154 | }
|
72154 | 72155 | else {
|
72155 | 72156 | this.selectDateTime(new Date());
|
@@ -72318,11 +72319,11 @@
|
72318 | 72319 | __metadata('design:type', Boolean)
|
72319 | 72320 | ], NguiDatetimePickerComponent.prototype, "useUtc", void 0);
|
72320 | 72321 | __decorate([
|
72321 |
| - core_1.Input('current-is-today'), |
| 72322 | + /* check directive */ core_1.Input('current-is-today'), |
72322 | 72323 | __metadata('design:type', Boolean)
|
72323 | 72324 | ], NguiDatetimePickerComponent.prototype, "currToday", void 0);
|
72324 | 72325 | __decorate([
|
72325 |
| - core_1.Output('selected$'), |
| 72326 | + /* check directive */ core_1.Output('selected$'), |
72326 | 72327 | __metadata('design:type', core_1.EventEmitter)
|
72327 | 72328 | ], NguiDatetimePickerComponent.prototype, "selected$", void 0);
|
72328 | 72329 | __decorate([
|
|
72403 | 72404 | this.closeOnSelect = true;
|
72404 | 72405 | this.showTodayShortcut = false;
|
72405 | 72406 | this.isDraggable = true;
|
72406 |
| - this.useUtc = false; |
72407 |
| - this.currToday = false; |
| 72407 | + this.useUtc = false; /* Change this attribute to true and the result of currentTime will be present in UTC */ |
| 72408 | + this.currToday = false; /* Change this attribute to true and the result of currentTime will be with 'today' date */ |
72408 | 72409 | this.ngModelChange = new core_1.EventEmitter();
|
72409 | 72410 | this.valueChanged$ = new core_1.EventEmitter();
|
72410 | 72411 | this.popupClosed$ = new core_1.EventEmitter();
|
@@ -72774,11 +72775,11 @@
|
72774 | 72775 | __metadata('design:type', Boolean)
|
72775 | 72776 | ], NguiDatetimePickerDirective.prototype, "useUtc", void 0);
|
72776 | 72777 | __decorate([
|
72777 |
| - core_1.Input('current-is-today'), |
| 72778 | + /* Change this attribute to true and the result of currentTime will be present in UTC */ core_1.Input('current-is-today'), |
72778 | 72779 | __metadata('design:type', Boolean)
|
72779 | 72780 | ], NguiDatetimePickerDirective.prototype, "currToday", void 0);
|
72780 | 72781 | __decorate([
|
72781 |
| - core_1.Input('ngModel'), |
| 72782 | + /* Change this attribute to true and the result of currentTime will be with 'today' date */ core_1.Input('ngModel'), |
72782 | 72783 | __metadata('design:type', Object)
|
72783 | 72784 | ], NguiDatetimePickerDirective.prototype, "ngModel", void 0);
|
72784 | 72785 | __decorate([
|
|
82729 | 82730 | //noinspection TypeScriptCheckImport
|
82730 | 82731 | var datetime_picker_1 = __webpack_require__(341);
|
82731 | 82732 | moment['locale']('en-ca'); //e.g. fr-ca
|
82732 |
| - var templateStr = "\n <div id=\"my-div\">\n <h1>Ng2 DateTime Picker Test</h1>\n \n <fieldset id=\"test2\"><legend><h2>min date, max date, disabled dates</h2></legend>\n <ngui-utils-2>\n <input\n [(ngModel)]=\"date2\" \n ngui-datetime-picker\n [disabled-dates]=\"date2DisabledDates\"\n [min-date]=\"date2MinDate\"\n [max-date]=\"date2MaxDate\"\n [show-close-layer]=\"true\"\n [show-week-numbers]=\"true\"\n [is-draggable]=\"false\"\n date-only=\"true\"/>\n date2: {{date2}}\n <button id=\"set-date\" (click)=\"date2 = date2New\">Set 2017-12-31</button>\n </ngui-utils-2>\n <pre>{{templateStr | htmlCode:'ngui-utils-2'}}</pre>\n </fieldset>\n \n <fieldset id=\"test3\"><legend><h2>time only</h2></legend>\n <ngui-utils-4>\n <input [(ngModel)]=\"date3\"\n ngui-datetime-picker \n date-format=\"DD-MM-YYYY hh:mm\"\n time-only=\"true\"\n minute-step=\"5\"\n (popupClosed)=\"onDatetimePickerClosed()\"\n [close-on-select]=\"false\" />\n </ngui-utils-4>\n <button (click)=\"date3='Thu Jan 31 2015 00:00:00 GMT-0500 (EST)'\">Change</button>\n <pre>{{templateStr | htmlCode:'ngui-utils-4'}}</pre>\n </fieldset>\n \n <fieldset id=\"test4\"><legend><h2>with timezone</h2></legend>\n <ngui-utils-6>\n <input \n [(ngModel)]=\"date4\" \n ngui-datetime-picker\n [date-format]=\"date4TimezoneFormat\" />\n dateWithTimezone: {{dateWithTimezone}}\n <br/>\n </ngui-utils-6>\n <pre>{{templateStr | htmlCode:'ngui-utils-6'}}</pre>\n </fieldset>\n \n <fieldset id=\"test5\"><legend><h2>Reactive form</h2></legend>\n <ngui-utils-3>\n <form [formGroup]=\"myForm\">\n <input \n required\n formControlName=\"date\" \n ngui-datetime-picker\n [close-on-select]=\"false\"\n [use-utc]=\"true\"\n [current-is-today]=\"true\"/>\n </form>\n myForm.controls.date.value: {{myForm.controls.date.value}}\n <br/>myForm.value: {{myForm.value | json}}\n <br/>myForm.dirty: {{myForm.dirty}}\n <br/>myForm.controls.date.dirty: {{myForm.controls.date.dirty}}\n <br/>\n <a href=\"javascript:void()\" \n (click)=\"myForm.controls.date.patchValue('2015-06-30')\">\n 2015-06-30\n </a>\n <a href=\"javascript:void()\"\n (click)=\"myForm.controls.date.patchValue('2015-07-19')\">\n 2015-07-19\n </a>\n <a href=\"javascript:void()\"\n (click)=\"myForm.controls.date.patchValue('2015-12-31')\">\n 2015-12-31\n </a>\n </ngui-utils-3>\n <pre>{{templateStr | htmlCode:'ngui-utils-3'}}</pre>\n </fieldset>\n\n <fieldset id=\"test6\">\n <legend><h2>Material Design</h2></legend>\n <ngui-utils-4>\n <md-input-container>\n <input mdInput \n [(ngModel)]=\"mdDate\"\n name=\"mdDate\"\n ngui-datetime-picker\n date-only=\"true\" \n [close-on-select]=\"false\" />\n </md-input-container>\n </ngui-utils-4>\n </fieldset>\n\n </div>\n"; |
| 82733 | + var templateStr = "\n <div id=\"my-div\">\n <h1>Ng2 DateTime Picker Test</h1>\n \n <fieldset id=\"test2\"><legend><h2>min date, max date, disabled dates</h2></legend>\n <ngui-utils-2>\n <input\n [(ngModel)]=\"date2\" \n ngui-datetime-picker\n [disabled-dates]=\"date2DisabledDates\"\n [min-date]=\"date2MinDate\"\n [max-date]=\"date2MaxDate\"\n [show-close-layer]=\"true\"\n [show-week-numbers]=\"true\"\n [is-draggable]=\"false\"\n date-only=\"true\"/>\n date2: {{date2}}\n <button id=\"set-date\" (click)=\"date2 = date2New\">Set 2017-12-31</button>\n </ngui-utils-2>\n <pre>{{templateStr | htmlCode:'ngui-utils-2'}}</pre>\n </fieldset>\n \n <fieldset id=\"test3\"><legend><h2>time only</h2></legend>\n <ngui-utils-4>\n <input [(ngModel)]=\"date3\"\n ngui-datetime-picker \n date-format=\"DD-MM-YYYY hh:mm\"\n time-only=\"true\"\n minute-step=\"5\"\n (popupClosed)=\"onDatetimePickerClosed()\"\n [close-on-select]=\"false\" />\n </ngui-utils-4>\n <button (click)=\"date3='Thu Jan 31 2015 00:00:00 GMT-0500 (EST)'\">Change</button>\n <pre>{{templateStr | htmlCode:'ngui-utils-4'}}</pre>\n </fieldset>\n \n <fieldset id=\"test4\"><legend><h2>with timezone</h2></legend>\n <ngui-utils-6>\n <input \n [(ngModel)]=\"date4\" \n ngui-datetime-picker\n [date-format]=\"date4TimezoneFormat\" />\n dateWithTimezone: {{dateWithTimezone}}\n <br/>\n </ngui-utils-6>\n <pre>{{templateStr | htmlCode:'ngui-utils-6'}}</pre>\n </fieldset>\n \n <fieldset id=\"test5\"><legend><h2>Reactive form</h2></legend>\n <ngui-utils-3>\n <form [formGroup]=\"myForm\">\n <input \n required\n formControlName=\"date\" \n ngui-datetime-picker\n [close-on-select]=\"false\"/>\n </form>\n myForm.controls.date.value: {{myForm.controls.date.value}}\n <br/>myForm.value: {{myForm.value | json}}\n <br/>myForm.dirty: {{myForm.dirty}}\n <br/>myForm.controls.date.dirty: {{myForm.controls.date.dirty}}\n <br/>\n <a href=\"javascript:void()\" \n (click)=\"myForm.controls.date.patchValue('2015-06-30')\">\n 2015-06-30\n </a>\n <a href=\"javascript:void()\"\n (click)=\"myForm.controls.date.patchValue('2015-07-19')\">\n 2015-07-19\n </a>\n <a href=\"javascript:void()\"\n (click)=\"myForm.controls.date.patchValue('2015-12-31')\">\n 2015-12-31\n </a>\n </ngui-utils-3>\n <pre>{{templateStr | htmlCode:'ngui-utils-3'}}</pre>\n </fieldset>\n\n <fieldset id=\"test6\">\n <legend><h2>Material Design</h2></legend>\n <ngui-utils-4>\n <md-input-container>\n <input mdInput \n [(ngModel)]=\"mdDate\"\n name=\"mdDate\"\n ngui-datetime-picker\n date-only=\"true\" \n [close-on-select]=\"false\" />\n </md-input-container>\n </ngui-utils-4>\n </fieldset>\n\n </div>\n"; |
82733 | 82734 | var DirectiveTestComponent = (function () {
|
82734 | 82735 | function DirectiveTestComponent(fb) {
|
82735 | 82736 | this.fb = fb;
|
|
0 commit comments