fix(datetime): check for null instead of undefined

fixes #15605
This commit is contained in:
Brandy Carney
2018-09-18 15:56:17 -04:00
parent fa7701721c
commit 407b14778d

View File

@ -503,7 +503,7 @@ export class Datetime implements ComponentInterface {
hostData() {
const addPlaceholderClass =
(this.text === undefined && this.placeholder != null) ? true : false;
(this.text == null && this.placeholder != null) ? true : false;
return {
class: {
@ -519,8 +519,8 @@ export class Datetime implements ComponentInterface {
// If selected text has been passed in, use that first
// otherwise use the placeholder
let datetimeText = this.text;
if (datetimeText === undefined) {
datetimeText = this.placeholder ? this.placeholder : '';
if (datetimeText == null) {
datetimeText = this.placeholder != null ? this.placeholder : '';
}
return [