Skip to content
This repository was archived by the owner on Mar 2, 2018. It is now read-only.

Commit 7865e8d

Browse files
committed
2 parents 1726464 + a83a431 commit 7865e8d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/datetime-picker.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ declare var moment: any;
174174
}
175175
.ngui-datetime-picker .days {
176176
width: 210px; /* 30 x 7 days */
177+
box-sizing: content-box;
177178
}
178179
.ngui-datetime-picker .close-button {
179180
position: absolute;
@@ -182,6 +183,7 @@ declare var moment: any;
182183
right: 0;
183184
z-index: 1;
184185
padding: 0 5px;
186+
box-sizing: content-box;
185187
}
186188
.ngui-datetime-picker .close-button:before {
187189
content: 'X';
@@ -209,6 +211,7 @@ declare var moment: any;
209211
cursor: pointer;
210212
width: 25px;
211213
text-align: center;
214+
box-sizing: content-box;
212215
}
213216
.ngui-datetime-picker > .month > .prev_next:hover {
214217
background-color: #333;
@@ -232,18 +235,19 @@ declare var moment: any;
232235
text-align: right;
233236
width: 21px;
234237
vertical-align: top;
238+
box-sizing: content-box;
235239
}
236240
237241
.ngui-datetime-picker .days {
238242
display: inline-block;
239243
width: 210px; /* 30 x 7 */
240244
text-align: center;
241245
padding: 0 10px;
246+
box-sizing: content-box;
242247
}
243248
.ngui-datetime-picker .days .day-of-week,
244249
.ngui-datetime-picker .days .day {
245250
box-sizing: border-box;
246-
-moz-box-sizing: border-box;
247251
border: 1px solid transparent;
248252
width: 30px;
249253
line-height: 28px;
@@ -319,6 +323,7 @@ declare var moment: any;
319323
display: inline-block;
320324
width: 45px;
321325
vertical-align: top;
326+
box-sizing: content-box;
322327
}
323328
.closing-layer {
324329
display: block;

src/datetime-picker.directive.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class NguiDatetimePickerDirective implements OnInit, OnChanges {
4646
@Input('max-hour') maxHour: Date | number;
4747
@Input('disabled-dates') disabledDates: Date[];
4848
@Input('show-close-layer') showCloseLayer: boolean;
49+
@Input('show-today-shortcut') showTodayShortcut: boolean = false;
4950
@Input('show-week-numbers') showWeekNumbers: boolean;
5051
@Input() formControlName: string;
5152
@Input('is-draggable') isDraggable: boolean = true;
@@ -280,6 +281,7 @@ export class NguiDatetimePickerDirective implements OnInit, OnChanges {
280281
component.disabledDates = this.disabledDates;
281282
component.showCloseButton = this.closeOnSelect === false;
282283
component.showCloseLayer = this.showCloseLayer;
284+
component.showTodayShortcut = this.showTodayShortcut;
283285
component.showWeekNumbers = this.showWeekNumbers;
284286

285287
this.styleDatetimePicker();

src/datetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class NguiDatetime {
7777
ret = d.getFullYear() + '-' + pad0(d.getMonth() + 1) + '-' + pad0(d.getDate());
7878
ret += dateOnly ? '' : ' ' + pad0(d.getHours()) + ':' + pad0(d.getMinutes());
7979
return ret;
80-
} else if (d && moment) {
80+
} else if (d && typeof moment !== 'undefined') {
8181
return moment(d).format(format);
8282
} else {
8383
return '';

0 commit comments

Comments
 (0)