MCPcopy Index your code
hub / github.com/codecombat/codecombat / activeProducts

Method activeProducts

app/models/User.js:873–881  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

871 }
872
873 activeProducts (type) {
874 const now = new Date()
875 return _.filter((this.get('products') || []), p => {
876 if (p.product !== type) return false
877 const hasValidEndDate = (p.endDate && new Date(p.endDate) > now) || !p.endDate
878 const hasValidStartDate = !p.startDate || new Date(p.startDate) <= now
879 return hasValidEndDate && hasValidStartDate
880 })
881 }
882
883 expiredProducts (type) {
884 const now = new Date()

Callers 14

hasSubscriptionMethod · 0.95
isPaidOnlineClassUserMethod · 0.95
premiumEndDateMethod · 0.95
prepaidTypeMethod · 0.95
prepaidIncludesCourseMethod · 0.95
findCourseProductMethod · 0.95
revokeLicensesFunction · 0.80

Calls 2

getMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected