()
| 553 | } |
| 554 | |
| 555 | premiumEndDate () { |
| 556 | if (!this.isPremium()) { return null } |
| 557 | let stripeEnd |
| 558 | const stripe = this.get('stripe') |
| 559 | if (stripe) { |
| 560 | if (stripe.free === true) { return $.t('subscribe.forever') } |
| 561 | if (stripe.sponsorID) { return $.t('subscribe.forever') } |
| 562 | if (stripe.subscriptionID) { return $.t('subscribe.forever') } |
| 563 | if (_.isString(stripe.free)) { stripeEnd = moment(stripe.free) } |
| 564 | } |
| 565 | |
| 566 | const products = this.get('products') |
| 567 | if (products) { |
| 568 | const homeProducts = this.activeProducts('basic_subscription') |
| 569 | const { |
| 570 | endDate, |
| 571 | } = _.max(homeProducts, p => new Date(p.endDate)) |
| 572 | const productsEnd = moment(endDate) |
| 573 | if (stripeEnd && stripeEnd.isAfter(productsEnd)) { return stripeEnd.utc().format('ll') } |
| 574 | return productsEnd.utc().format('ll') |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | isPremium () { |
| 579 | if (this.isInGodMode()) { return true } |
nothing calls this directly
no test coverage detected