@financial-times/community-event-client
Advanced tools
Comparing version 1.4.0 to 1.5.0-alpha.2327.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [1.5.0-alpha.2327.0](https://github.com/Financial-Times/community-promo-kit/compare/@financial-times/community-event-client@1.4.0...@financial-times/community-event-client@1.5.0-alpha.2327.0) (2024-09-02) | ||
### Features | ||
- **@financial-times/community-event-client:** added a new get live events option for filtering ([68dfd40](https://github.com/Financial-Times/community-promo-kit/commit/68dfd40bfb1fbb949a143294c04073b802e48462)) | ||
# [1.4.0](https://github.com/Financial-Times/community-promo-kit/compare/@financial-times/community-event-client@1.4.0-alpha.2275.1...@financial-times/community-event-client@1.4.0) (2024-07-30) | ||
@@ -8,0 +14,0 @@ |
@@ -15,2 +15,3 @@ import { LiveEventsPoller } from "./live-events-poller"; | ||
startsBefore?: Date; | ||
endsAfter?: Date; | ||
} | ||
@@ -17,0 +18,0 @@ export declare function getLiveEvents(options?: GetLiveEventsOptions): LiveEvent[]; |
@@ -45,2 +45,9 @@ "use strict"; | ||
} | ||
if (options?.endsAfter) { | ||
events = events.filter((event) => { | ||
return (event.endDate && | ||
new Date(event.endDate).getTime() >= | ||
(options?.endsAfter?.getTime() ?? new Date().getTime())); | ||
}); | ||
} | ||
return events; | ||
@@ -47,0 +54,0 @@ } |
{ | ||
"name": "@financial-times/community-event-client", | ||
"version": "1.4.0", | ||
"version": "1.5.0-alpha.2327.0", | ||
"description": "A client for retrieving community-events", | ||
@@ -27,3 +27,3 @@ "main": "dist/serverside.js", | ||
}, | ||
"gitHead": "8b4d222eab160be98b72f5818398550897d03e28" | ||
"gitHead": "0b2d738d47c12c3444eacc2a9ab727fbcebd063e" | ||
} |
@@ -42,2 +42,3 @@ import { LiveEventsPoller } from "./live-events-poller"; | ||
startsBefore?: Date; | ||
endsAfter?: Date; | ||
} | ||
@@ -69,2 +70,12 @@ | ||
if(options?.endsAfter) { | ||
events = events.filter((event) => { | ||
return ( | ||
event.endDate && | ||
new Date(event.endDate).getTime() >= | ||
(options?.endsAfter?.getTime() ?? new Date().getTime()) | ||
); | ||
}); | ||
} | ||
return events; | ||
@@ -71,0 +82,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131642
2296
2