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