@financial-times/community-event-client
Advanced tools
Comparing version 1.3.0 to 1.4.0-alpha.2275.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [1.4.0-alpha.2275.0](https://github.com/Financial-Times/community-promo-kit/compare/@financial-times/community-event-client@1.3.0...@financial-times/community-event-client@1.4.0-alpha.2275.0) (2024-07-19) | ||
### Features | ||
- **@financial-times/community-event-client:** added another filter to getLiveEvents functionality ([37c27b6](https://github.com/Financial-Times/community-promo-kit/commit/37c27b63cc7a1ac5ab88487cd48752ce3f59de07)) | ||
# [1.3.0](https://github.com/Financial-Times/community-promo-kit/compare/@financial-times/community-event-client@1.3.0-alpha.2209.1...@financial-times/community-event-client@1.3.0) (2024-06-18) | ||
@@ -8,0 +14,0 @@ |
@@ -14,2 +14,3 @@ import { LiveEventsPoller } from "./live-events-poller"; | ||
startDate?: Date; | ||
startsBefore?: Date; | ||
} | ||
@@ -16,0 +17,0 @@ export declare function getLiveEvents(options?: GetLiveEventsOptions): LiveEvent[]; |
@@ -38,2 +38,9 @@ "use strict"; | ||
} | ||
if (options?.startsBefore) { | ||
events = events.filter((event) => { | ||
return (event.startDate && | ||
new Date(event.startDate).getTime() <= | ||
(options?.startDate?.getTime() ?? new Date().getTime())); | ||
}); | ||
} | ||
return events; | ||
@@ -40,0 +47,0 @@ } |
{ | ||
"name": "@financial-times/community-event-client", | ||
"version": "1.3.0", | ||
"version": "1.4.0-alpha.2275.0", | ||
"description": "A client for retrieving community-events", | ||
@@ -27,3 +27,3 @@ "main": "dist/serverside.js", | ||
}, | ||
"gitHead": "313d97acc80f6202a84bca9be8aac0e3830a504c" | ||
"gitHead": "1651a9fbd9d1aeb3207bb188bbd3cfb6285a1ded" | ||
} |
@@ -41,2 +41,3 @@ import { LiveEventsPoller } from "./live-events-poller"; | ||
startDate?: Date; | ||
startsBefore?: Date; | ||
} | ||
@@ -58,2 +59,12 @@ | ||
if (options?.startsBefore) { | ||
events = events.filter((event) => { | ||
return ( | ||
event.startDate && | ||
new Date(event.startDate).getTime() <= | ||
(options?.startDate?.getTime() ?? new Date().getTime()) | ||
); | ||
}); | ||
} | ||
return events; | ||
@@ -60,0 +71,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
129532
2278
2