Skip to content

Commit

Permalink
fix(datetime): check for null instead of undefined
Browse files Browse the repository at this point in the history
fixes #15605
  • Loading branch information
brandyscarney committed Sep 18, 2018
1 parent fa77017 commit 407b147
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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 [
Expand Down

0 comments on commit 407b147

Please sign in to comment.