adopted-ember-addons / adopted-ember-addons/ember-moment

isSameOrAfter Returning False when It Should Be True

Đang mở
#272 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
398
Fork
120
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

So I am trying to do the following to compare 2 dates, but its returning false when it should be true. Here is what my code looks like

```
let moment = self.get('moment');
let apptTime = moment.moment(appointment.get('startDateTime'));
let currentTime = moment.moment().tz('PST');

console.log(`API Time Returned: ${appointment.get('startDateTime')}`)
console.log(`Current Time: ${currentTime.format('MM/DD h:mm a')}`);
console.log(`Appt Time: ${apptTime.format('MM/DD h:mm a')}`);

return apptTime.isSameOrAfter(currentTime);
```

Here is what is in my console log

```
API Time Returned: /Date(1517322900000-0500)/
Current Time: 01/30 8:16 am
Appt Time: 01/30 9:35 am
```

So what am I missing? Thanks

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.