fix(events): events date range filter (#2532)

* fix(events): consider end dates when filtering

* chore: update fetched data

* test(events): isEventInDateRange function
This commit is contained in:
Eddybrando Vásquez 2022-04-01 11:32:48 +02:00 committed by GitHub
parent 25832328f8
commit 57245f31d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 434 additions and 60 deletions

View File

@ -11,6 +11,7 @@
{
"name": "Abeer Vaishnav",
"image": "https://dl.airtable.com/.attachmentThumbnails/95c6560ceb7525d5a344216d544369b7/bc8262f2",
"region": "North America",
"city": "Durham",
"country": "United States",
"slackId": "U01313A0AGP",
@ -19,6 +20,7 @@
{
"name": "Abhay Kamble",
"image": "https://dl.airtable.com/.attachmentThumbnails/067f9ef412aba3b9fd77f0ff70eeffa1/d9acaed4",
"region": "Asia",
"city": "Nagpur",
"country": "India",
"slackId": "U018CGFAWDT",
@ -36,6 +38,7 @@
{
"name": "Abhijit Mitra",
"image": "https://dl.airtable.com/.attachmentThumbnails/c3e8107db8673a603424787b635415e3/7acf7ef1",
"region": "North America",
"city": "The Woodlands",
"country": "United States",
"slackId": "WJ3GWDP5X",
@ -44,6 +47,7 @@
{
"name": "Abhishek Jayachandran",
"image": "https://dl.airtable.com/.attachmentThumbnails/138e2fcf907a326aa4bd9ffe8175ab3f/40e0a642",
"region": "Asia",
"city": "Ernakulam",
"country": "India",
"slackId": "U013ZUVHRA4",
@ -52,6 +56,7 @@
{
"name": "Aboulkhair Foda",
"image": "https://dl.airtable.com/.attachmentThumbnails/a6648fc814e3dd52c58ad3f4738d78f4/81a0bbb7",
"region": "Asia",
"city": "Riyadh",
"country": "Saudi Arabia",
"slackId": "U01DP6C85D3",
@ -60,6 +65,7 @@
{
"name": "Adarsh Chandrashekar",
"image": "https://dl.airtable.com/.attachmentThumbnails/585e874b48bbf9bb1df46ba514276a85/6712f65b",
"region": "Asia",
"city": "Bhopal",
"country": "India",
"slackId": "U01DX5MBR1U",
@ -77,6 +83,7 @@
{
"name": "Adrien Suau",
"image": "https://dl.airtable.com/.attachmentThumbnails/e486c075eba42073edcbdf5cc110f9bb/185b4ef2",
"region": "Europe",
"city": "Toulouse",
"country": "France",
"slackId": "U96102NLE",
@ -85,6 +92,7 @@
{
"name": "Alain Chancé",
"image": "https://dl.airtable.com/.attachmentThumbnails/d507eb0c6fe1e21b64f92fb1a059f866/2a4d2bc6",
"region": "Europe",
"city": "Houdan",
"country": "France",
"slackId": "U012UGUSA3G",
@ -102,6 +110,7 @@
{
"name": "Alberto Maldonado Romo",
"image": "https://dl.airtable.com/.attachmentThumbnails/a3ed8f240f75d556059a2c048fa783bb/81073f9b",
"region": "North America",
"city": "Mexico city",
"country": "Mexico",
"slackId": "U0171GNE630",
@ -110,6 +119,7 @@
{
"name": "Alejandro Montanez",
"image": "https://dl.airtable.com/.attachmentThumbnails/d1b181d092ba31136521b4a06f0188ed/f1ecc683",
"region": "South America",
"city": "Tunja",
"country": "Colombia",
"slackId": "U01305FGJH0",
@ -135,6 +145,7 @@
{
"name": "Amandeep Singh Bhatia",
"image": "https://dl.airtable.com/.attachmentThumbnails/4a1bf687883795423d48a20fd0fbb968/1738cadf",
"region": "Asia",
"city": "NALAGARH",
"country": "India",
"slackId": "U01868CL188",
@ -143,6 +154,7 @@
{
"name": "Amaury de Miguel",
"image": "https://dl.airtable.com/.attachmentThumbnails/8753402ed7939c2deb7a2de0b6ec8bf0/70abcf14",
"region": "Europe",
"city": "Paris",
"country": "France",
"slackId": "U01RA082JG1",
@ -186,6 +198,7 @@
{
"name": "Anton Simen ",
"image": "https://dl.airtable.com/.attachmentThumbnails/23abccfbc07fb9f74c2bf1143ee2efbe/0c203a9e",
"region": "South America",
"city": "Miracema",
"country": "Brazil",
"slackId": "U015BV08CAV",
@ -212,6 +225,7 @@
{
"name": "Anuj Mehrotra",
"image": "https://dl.airtable.com/.attachmentThumbnails/c4cbf35f999945388c9602141ee4117a/282cd0b0",
"region": "Asia",
"city": "Ghaziabad",
"country": "India",
"slackId": "U019Y87CW81",
@ -229,6 +243,7 @@
{
"name": "Anuranan Das",
"image": "https://dl.airtable.com/.attachmentThumbnails/07aa351bd31236905bdd4e51a87e48ed/9362ad90",
"region": "Asia",
"city": "Raiganj",
"country": "India",
"slackId": "U017SGVKFJN",
@ -237,6 +252,7 @@
{
"name": "Areeq Hasan",
"image": "https://dl.airtable.com/.attachmentThumbnails/57c969484de12e84e5be9a736370fdb4/dd7b7213",
"region": "North America",
"city": "Princeton",
"country": "United States",
"slackId": "U01E3NAF5DX",
@ -245,6 +261,7 @@
{
"name": "Arnaldo Satoru Gunzi",
"image": "https://dl.airtable.com/.attachmentThumbnails/a8b9780a286eb4f7c620bbad5b382582/61bb7ca7",
"region": "South America",
"city": "SÃO PAULO",
"country": "Brazil",
"slackId": "U012TEYCK8E",
@ -253,6 +270,7 @@
{
"name": "Ashish Panigrahi",
"image": "https://dl.airtable.com/.attachmentThumbnails/6776d1f5d0ca0eb7a27c5747d3781c4e/1f690b1c",
"region": "Asia",
"city": "Chennai",
"country": "India",
"slackId": "UPFLZUPH8",
@ -270,6 +288,7 @@
{
"name": "Balaji Seetharaman",
"image": "https://dl.airtable.com/.attachmentThumbnails/3a672ff7a50c260f46a98488648eaa40/57048571",
"region": "Asia",
"city": "Sivakasi",
"country": "India",
"slackId": "U025Y9QAX5X",
@ -278,6 +297,7 @@
{
"name": "Bartu Bisgin",
"image": "https://dl.airtable.com/.attachmentThumbnails/8a370f9abbefe9be0cd094dd5273f39c/0e65afa3",
"region": "Europe",
"city": "Munich",
"country": "Germany",
"slackId": "U01TE3W84SY",
@ -295,6 +315,7 @@
{
"name": "Billy Lim",
"image": "https://dl.airtable.com/.attachmentThumbnails/ba20e0fde7f86ae01aee99c78a0168b6/89fdaeb4",
"region": "Asia",
"city": "Singapore",
"country": "Singapore",
"slackId": "U01812T7E9Z",
@ -312,6 +333,7 @@
{
"name": "Calum Holker",
"image": "https://dl.airtable.com/.attachmentThumbnails/43026f3e0f7d7cfcc8e6669afbdc21b9/e27224a8",
"region": "Europe",
"city": "Oxford",
"country": "United Kingdom",
"slackId": "U01EF5HNNTA",
@ -329,6 +351,7 @@
{
"name": "Catalina Albornoz",
"image": "https://dl.airtable.com/.attachmentThumbnails/fe0836db554878784fc18e9c536b9de0/ba067fea",
"region": "South America",
"city": "Bogota",
"country": "Colombia",
"slackId": "WSWCPCUUA",
@ -346,6 +369,7 @@
{
"name": "Cheryl Fillekes",
"image": "https://dl.airtable.com/.attachmentThumbnails/8b0bbdeb53f9b41e6d2f4590c1c6e112/156b6347",
"region": "North America",
"city": "Poughkeepsie",
"country": "United States",
"slackId": "U014G3511NZ",
@ -363,6 +387,7 @@
{
"name": "Claudia Zendejas-Morales",
"image": "https://dl.airtable.com/.attachmentThumbnails/6edc673d95431a48f7689b12f7f8623c/33d7ffc6",
"region": "North America",
"city": "Mexico City",
"country": "Mexico",
"slackId": "U017BK2S8CA",
@ -371,6 +396,7 @@
{
"name": "Coleman Collins",
"image": "https://dl.airtable.com/.attachmentThumbnails/bfe355cffaf7bf7558786809f2523344/c0a81372",
"region": "North America",
"city": "Chicago",
"country": "United States",
"slackId": "U9LS8URCY",
@ -379,6 +405,7 @@
{
"name": "Conrad Haupt",
"image": "https://dl.airtable.com/.attachmentThumbnails/55a8c05a7c4771c760ba3fa0ee4cd8f4/8dea5f75",
"region": "Africa",
"city": "Johannesburg",
"country": "South Africa",
"slackId": "UKCSAB24S",
@ -387,6 +414,7 @@
{
"name": "Daiki Murata",
"image": "https://dl.airtable.com/.attachmentThumbnails/5f87c88f02e93dad214adb8d5a0ab16c/8641846c",
"region": "Asia",
"city": "Tokyo",
"country": "Japan",
"slackId": "U01EGREAZ7W",
@ -413,6 +441,7 @@
{
"name": "Darsh Kaushik",
"image": "https://dl.airtable.com/.attachmentThumbnails/683f97bf4bf89b465de8594bac0a3100/4c19fe51",
"region": "Asia",
"city": "Mumbai",
"country": "India",
"slackId": "U019EM25U5B",
@ -447,6 +476,7 @@
{
"name": "Dayeong Kang",
"image": "https://dl.airtable.com/.attachmentThumbnails/fff38cd7f55840b207d9c62230c9431c/d6e881fa",
"region": "Asia",
"city": "Daegu",
"country": "South Korea",
"slackId": "U017W5LSXP0",
@ -472,6 +502,7 @@
{
"name": "Dhruv Bhatnagar",
"image": "https://dl.airtable.com/.attachmentThumbnails/c51324e33e86e55d151d4840c7ff340e/44971ace",
"region": "Europe",
"city": "Delft",
"country": "Netherlands",
"slackId": "U01SYLPCULW",
@ -507,6 +538,7 @@
{
"name": "Dongsin Kim",
"image": "https://dl.airtable.com/.attachmentThumbnails/d4e4e21c987edfa35c1eee3b549f6af9/afa40e55",
"region": "Asia",
"city": "Changwon-si",
"country": "South Korea",
"slackId": "ULGH52A67",
@ -533,6 +565,7 @@
{
"name": "Eddybrando Vásquez",
"image": "https://dl.airtable.com/.attachmentThumbnails/ef03dcd6aeac6f6989ce378a3a527903/57ba09f3",
"region": "Europe",
"city": "Munich",
"country": "Germany",
"slackId": "U01F6BV18AD",
@ -550,6 +583,7 @@
{
"name": "Edwin Navarro",
"image": "https://dl.airtable.com/.attachmentThumbnails/8894efd17070a099683f0f53764b1d72/7ffa7ef4",
"region": "North America",
"city": "Mill Valley",
"country": "United States",
"slackId": "U013JDF3PE0",
@ -567,6 +601,7 @@
{
"name": "Elbert Timothy Lasiman",
"image": "https://dl.airtable.com/.attachmentThumbnails/8ec428f5d8ee86a789183676431fbf7e/58354e9d",
"region": "Asia",
"city": "Jakarta",
"country": "Indonesia",
"slackId": "U01DRH6GJ03",
@ -575,6 +610,7 @@
{
"name": "Elena Peña Tapia",
"image": "https://dl.airtable.com/.attachmentThumbnails/a60fda5e5d941e7e635d85cfbc3cdb5c/2348f76c",
"region": "Asia",
"city": "Tokyo",
"country": "Japan",
"slackId": "UQ6GHXH95",
@ -601,6 +637,7 @@
{
"name": "Emilio Peláez Cisneros",
"image": "https://dl.airtable.com/.attachmentThumbnails/ed14e8248df76a1eec40ec69cc78945b/5966a015",
"region": "North America",
"city": "Puebla",
"country": "Mexico",
"slackId": "U01E422TCQH",
@ -645,6 +682,7 @@
{
"name": "Florian Preis",
"image": "https://dl.airtable.com/.attachmentThumbnails/01743061459cd59cbd16e98a0240df9a/bf94af22",
"region": "Europe",
"city": "Vienna",
"country": "Austria",
"slackId": "U012MQM08UF",
@ -680,6 +718,7 @@
{
"name": "Freya Shah",
"image": "https://dl.airtable.com/.attachmentThumbnails/1f1b54e31f3e2a8003b23765ac0b1d80/a69ed678",
"region": "Asia",
"city": "Ahmedabad",
"country": "India",
"slackId": "U020Q4WL5EY",
@ -688,6 +727,7 @@
{
"name": "Gabriele Agliardi",
"image": "https://dl.airtable.com/.attachmentThumbnails/a0bb58c8629641ff6e06e2eef4a6e07d/9b238ec5",
"region": "Europe",
"city": "Milan",
"country": "Italy",
"slackId": "U01M99PA9D4",
@ -696,6 +736,7 @@
{
"name": "GAYATHREE M VINOD",
"image": "https://dl.airtable.com/.attachments/eb64581cbf568a98f902b9090f95d1e2/4e56e8e6/Gaya3_photo.jpg",
"region": "Asia",
"city": "KOCHI",
"country": "India",
"slackId": "U017BUC6XL4",
@ -704,6 +745,7 @@
{
"name": "George Zhou",
"image": "https://dl.airtable.com/.attachmentThumbnails/a5adea5d44052712bdd5d790d07c2055/67044f30",
"region": "North America",
"city": "Lake Worth, FL",
"country": "United States",
"slackId": "U01FULVJFUK",
@ -730,6 +772,7 @@
{
"name": "Ginés Carrascal de las Heras",
"image": "https://dl.airtable.com/.attachmentThumbnails/18b9a95a1a116deb9c4b6d3978543bc1/8cfe96ea",
"region": "Europe",
"city": "Madrid",
"country": "Spain",
"slackId": "UNNSJ0B62",
@ -738,6 +781,7 @@
{
"name": "Guncha Malik",
"image": "https://dl.airtable.com/.attachmentThumbnails/f8f158158510ebe93ef616e892b96a15/c8dd431f",
"region": "Asia",
"city": "Pune",
"country": "India",
"slackId": "U0163LLPR8B",
@ -746,6 +790,7 @@
{
"name": "Gyeonghun Kim",
"image": "https://dl.airtable.com/.attachments/85ae3222b02f2bae1c1b7ba72a469fb4/4ec2de42/20210817_150135.jpg",
"region": "Asia",
"city": "Seoul",
"country": "South Korea",
"slackId": "U017TTJQ9JR",
@ -754,6 +799,7 @@
{
"name": "Harshit Gupta",
"image": "https://dl.airtable.com/.attachmentThumbnails/06c40ab26159404f6e06abbc83689c33/1d45421c",
"region": "Asia",
"city": "Noida",
"country": "India",
"slackId": "U01J1753VR8",
@ -762,6 +808,7 @@
{
"name": "Hayk Sargsyan",
"image": "https://dl.airtable.com/.attachmentThumbnails/d24884b96742996434cf4848f49c0d4f/3f9c04f7",
"region": "Europe",
"city": "Espoo",
"country": "Finland",
"slackId": "U012L1LBJBZ",
@ -787,6 +834,7 @@
{
"name": "Hitanshu Gedam",
"image": "https://dl.airtable.com/.attachmentThumbnails/537d74cb0dba77c78562e5d13db6d6be/450338a9",
"region": "Asia",
"city": "Nagpur",
"country": "India",
"slackId": "U014DA23Q79",
@ -795,6 +843,7 @@
{
"name": "Hoang Van",
"image": "https://dl.airtable.com/.attachmentThumbnails/54be2014e272158b7ee05a7ba91af7ec/0dad3ea8",
"region": "North America",
"city": "Norman",
"country": "United States",
"slackId": "U01UN4U6W0J",
@ -803,6 +852,7 @@
{
"name": "Hojun Lee",
"image": "https://dl.airtable.com/.attachmentThumbnails/30a489f67f27ae4bf7307370ef1b920d/cd80cd46",
"region": "Asia",
"city": " Gwangmyeong",
"country": "South Korea",
"slackId": "U01LGHZU82J",
@ -820,6 +870,7 @@
{
"name": "Hyun Jin Kim",
"image": "https://dl.airtable.com/.attachmentThumbnails/5470efe86e87a3ec463c8f57a5b09e14/14c475b8",
"region": "North America",
"city": "Pittsburgh",
"country": "United States",
"slackId": "U020D4W12UX",
@ -846,6 +897,7 @@
{
"name": "Inho Choi ",
"image": "https://dl.airtable.com/.attachmentThumbnails/e618d177af90e0a717e015eb2ff3a165/4675b433",
"region": "Asia",
"city": "Seoul",
"country": "South Korea",
"slackId": "U01TEM6NWTC",
@ -897,6 +949,7 @@
{
"name": "Jakub Mrożek",
"image": "https://dl.airtable.com/.attachmentThumbnails/859929c12b2735fbe33913c023d0a72b/010ff205",
"region": "Europe",
"city": "Oxford",
"country": "United Kingdom",
"slackId": "U022C5DJAR3",
@ -905,6 +958,7 @@
{
"name": "Jale Ipekoglu",
"image": "https://dl.airtable.com/.attachmentThumbnails/8954beedcb2d9e93ce6817506783eaeb/af005752",
"region": "Asia",
"city": "Istanbul",
"country": "Turkey",
"slackId": "U017S0T0GUR",
@ -913,6 +967,7 @@
{
"name": "James Tricker",
"image": "https://dl.airtable.com/.attachments/972c50ed4099ddf8013efceeeab0e0da/296016b7/693831E2-14C8-4E82-A348-88840EDC9795.jpeg",
"region": "Europe",
"city": "Bristol",
"country": "United Kingdom",
"slackId": "U024Y0QM0U8",
@ -930,6 +985,7 @@
{
"name": "Jayesh Parashar",
"image": "https://dl.airtable.com/.attachmentThumbnails/9fbf18702a4c0102f69926bf82084025/fd3434ae",
"region": "Asia",
"city": "INDORE",
"country": "India",
"slackId": "U0288VC12BY",
@ -938,6 +994,7 @@
{
"name": "Jean-Michel TORRES",
"image": "https://dl.airtable.com/.attachmentThumbnails/33fe239c67bd8e0837f8a84b439853a1/b1fd755d",
"region": "Europe",
"city": "Perols",
"country": "France",
"slackId": "UFEV4PNRJ",
@ -946,6 +1003,7 @@
{
"name": "JeongWon Kim",
"image": "https://dl.airtable.com/.attachmentThumbnails/f31d95f342c5bc5c23358c57b02499e1/2ae1c8ba",
"region": "Asia",
"city": "suwon",
"country": "South Korea",
"slackId": "U01KP1V5K4K",
@ -954,6 +1012,7 @@
{
"name": "Jesus Omar Sistos Barron",
"image": "https://dl.airtable.com/.attachmentThumbnails/66483a8646882ed17c276fff62383a47/c1ae9ef0",
"region": "North America",
"city": "Rincon",
"country": "United States",
"slackId": "U016XE6PA4X",
@ -980,6 +1039,7 @@
{
"name": "Jinwoong \"Philip\" Kim",
"image": "https://dl.airtable.com/.attachmentThumbnails/8c07c6a07cf3521809ca8161ba59a30e/13acabca",
"region": "Europe",
"city": "Delft",
"country": "Netherlands",
"slackId": "U01MMK6UJ2G",
@ -1005,6 +1065,7 @@
{
"name": "José Victor Soares Scursulim",
"image": "https://dl.airtable.com/.attachmentThumbnails/88db70cde1e83cdb5f3c3b1991578cee/a1b47a33",
"region": "South America",
"city": "Vila Velha",
"country": "Brazil",
"slackId": "U017SJDRL6S",
@ -1084,6 +1145,7 @@
{
"name": "Kaushal Kishor Gagan",
"image": "https://dl.airtable.com/.attachmentThumbnails/60372c5ef5fefb46492931aec6995aba/876e2489",
"region": "Asia",
"city": "Ponda",
"country": "India",
"slackId": "U019CSRKUJJ",
@ -1145,6 +1207,7 @@
{
"name": "Léna Pérennès",
"image": "https://dl.airtable.com/.attachmentThumbnails/fb9d82689c290f8e7949c2c56ca98800/9d256bc9",
"region": "Europe",
"city": "Montpellier",
"country": "France",
"slackId": "UUTMHM611",
@ -1153,6 +1216,7 @@
{
"name": "Leonardo Placidi",
"image": "https://dl.airtable.com/.attachmentThumbnails/142c7396c624543b2fccc24d875c9fc2/f586adb1",
"region": "Europe",
"city": "Rome",
"country": "Italy",
"slackId": "U022QPYRKGA",
@ -1170,6 +1234,7 @@
{
"name": "Ljubomir Budinski",
"image": "https://dl.airtable.com/.attachmentThumbnails/b4b996991205d1f191577fe0ddfb7115/19497c21",
"region": "Europe",
"city": "Novi Sad",
"country": "Serbia",
"slackId": "UDQBFDXU5",
@ -1187,6 +1252,7 @@
{
"name": "Luis Eduardo Martinez Hernandez",
"image": "https://dl.airtable.com/.attachmentThumbnails/cc37b08d5316c4a834bd29ecd1de4cd1/aca06e37",
"region": "North America",
"city": "Mexico City",
"country": "Mexico",
"slackId": "U01GCEUGBP1",
@ -1195,6 +1261,7 @@
{
"name": "Lukas Burgholzer",
"image": "https://dl.airtable.com/.attachmentThumbnails/c90995cb701a2ec08c5057f126293445/80fe6479",
"region": "Europe",
"city": "Linz",
"country": "Austria",
"slackId": "UQ71T15J9",
@ -1203,6 +1270,7 @@
{
"name": "Luke Johnson",
"image": "https://dl.airtable.com/.attachmentThumbnails/6940f09a863646ccb73a6fff41bece2e/8d2acced",
"region": "Europe",
"city": "London",
"country": "United Kingdom",
"slackId": "U01E8PM10GM",
@ -1229,6 +1297,7 @@
{
"name": "Marcel Pfaffhauser",
"image": "https://dl.airtable.com/.attachmentThumbnails/e951fac6c20c6a4dda9163e4ed93b781/ec5a977a",
"region": "Europe",
"city": "Zürich",
"country": "Switzerland",
"slackId": "U01BYRXNKK8",
@ -1237,6 +1306,7 @@
{
"name": "Maria Violaris",
"image": "https://dl.airtable.com/.attachmentThumbnails/c4a45dd6c4728e8de66561cba4579d9c/ba4f3ed8",
"region": "Europe",
"city": "Oxford",
"country": "United Kingdom",
"slackId": "UQUMVSJTH",
@ -1263,6 +1333,7 @@
{
"name": "Massimiliano Incudini",
"image": "https://dl.airtable.com/.attachmentThumbnails/654038c48eec31000786fedea9d13ab0/4a701b65",
"region": "Europe",
"city": "MANTOVA",
"country": "Italy",
"slackId": "U0271EM5SGP",
@ -1271,6 +1342,7 @@
{
"name": "Matt Wright",
"image": "https://dl.airtable.com/.attachmentThumbnails/9ceb14fe7b69c32aadaedcc544306f15/ada00e55",
"region": "North America",
"city": "Kingston",
"country": "Canada",
"slackId": "U022DAKEYA2",
@ -1296,6 +1368,7 @@
{
"name": "Mehil Agarwal",
"image": "https://dl.airtable.com/.attachmentThumbnails/b7a0048e5de09796b5fbbda57eac76d8/6d7bbe38",
"region": "North America",
"city": "Portland",
"country": "United States",
"slackId": "U016R937DQU",
@ -1312,6 +1385,7 @@
{
"name": "Michael Rollin",
"image": "https://dl.airtable.com/.attachmentThumbnails/734069e31d763840777c4fff6a81fe2d/48e00ae6",
"region": "Europe",
"city": "Nice",
"country": "France",
"slackId": "UV40Y7CVC",
@ -1336,6 +1410,7 @@
{
"name": "Ming-Tso Wei",
"image": "https://dl.airtable.com/.attachmentThumbnails/abfe57cd1d0bb1060e7431837ef171c0/0e2082b7",
"region": "North America",
"city": "College Park",
"country": "United States",
"slackId": "U01DNAQLSTX",
@ -1361,6 +1436,7 @@
{
"name": "Mitesh Adake",
"image": "https://dl.airtable.com/.attachmentThumbnails/08f99b3e3476aabb103e56493d9c9b89/c15d7c58",
"region": "Asia",
"city": "Sangli",
"country": "India",
"slackId": "U0183R9UNQ1",
@ -1369,6 +1445,7 @@
{
"name": "Mohammad Ansah",
"image": "https://dl.airtable.com/.attachmentThumbnails/43313b3223b5f62a1eccf9838f2173bf/e65e2d8a",
"region": "Asia",
"city": "Kurnool",
"country": "India",
"slackId": "U022TEMF34L",
@ -1412,6 +1489,7 @@
{
"name": "Oskar",
"image": "https://dl.airtable.com/.attachmentThumbnails/4a2cfd614aab0e3e588f6b7e7dd0526e/7dc2927b",
"region": "Europe",
"city": "Warsaw",
"country": "Poland",
"slackId": "U01CTLBKNCA",
@ -1438,6 +1516,7 @@
{
"name": "Parmeet Singh Chani",
"image": "https://dl.airtable.com/.attachmentThumbnails/247306ca3b3d906ab1145099a497e20a/c8a75cdd",
"region": "Asia",
"city": "New Delhi ",
"country": "India",
"slackId": "U01SNHJ3TMY",
@ -1462,6 +1541,7 @@
{
"name": "Pedro Ripper",
"image": "https://dl.airtable.com/.attachmentThumbnails/b39fbc302aeaeb35092282b5844af690/5e58db18",
"region": "South America",
"city": "Rio de Janeiro",
"country": "Brazil",
"slackId": "U010R09HQMP",
@ -1487,6 +1567,7 @@
{
"name": "Pinaki Sen",
"image": "https://dl.airtable.com/.attachmentThumbnails/698a92fd034bf8ddfc09d81e49be09e8/19a3aa13",
"region": "Asia",
"city": "Kolkata",
"country": "India",
"slackId": "U01671DCZ0X",
@ -1495,6 +1576,7 @@
{
"name": "Prajjwal Vijaywargiya",
"image": "https://dl.airtable.com/.attachmentThumbnails/d6182c9c4e44d4bf5fddda95100c635f/b1f3fb33",
"region": "Asia",
"city": "Hyderabad",
"country": "India",
"slackId": "U019RQHRWBE",
@ -1503,6 +1585,7 @@
{
"name": "Pulkit Sinha",
"image": "https://dl.airtable.com/.attachmentThumbnails/37dce8fdb17c7fde9cb096d83f1b22d8/3201cd8b",
"region": "Asia",
"city": "Bengaluru",
"country": "India",
"slackId": "U0190DG3LQH",
@ -1511,6 +1594,7 @@
{
"name": "QiaoYi Lin",
"image": "https://dl.airtable.com/.attachmentThumbnails/8373de6e0cace70b912588395771f7d2/87909105",
"region": "Asia",
"city": "Chiayi",
"country": "Taiwan",
"slackId": "U01NF9BQ56J",
@ -1528,6 +1612,7 @@
{
"name": "R K Rupesh",
"image": "https://dl.airtable.com/.attachmentThumbnails/28fe60e9a58da063f646d3ac92ed5d0d/9c93f1eb",
"region": "Asia",
"city": "Hyderabad",
"country": "India",
"slackId": "U0173CCCW4F",
@ -1536,6 +1621,7 @@
{
"name": "Radha Pyari Sandhir",
"image": "https://dl.airtable.com/.attachmentThumbnails/edc462049a28c1fb8bd97b73c0706f76/43e9ce1c",
"region": "Asia",
"city": "New Delhi",
"country": "India",
"slackId": "U01367S8J7N",
@ -1562,6 +1648,7 @@
{
"name": "Rafał Pracht",
"image": "https://dl.airtable.com/.attachmentThumbnails/34a077bcebf26fc51b25da1ef12c2de1/e83b281f",
"region": "Europe",
"city": "Warsaw",
"country": "Poland",
"slackId": "U020N7Z4095",
@ -1571,14 +1658,15 @@
"name": "Rahul Pratap Singh",
"image": "https://dl.airtable.com/.attachmentThumbnails/0e7f45986237cac83cd69fc0a20d5d66/8ffcf55a",
"region": "Asia",
"city": "Katni",
"country": "India",
"city": "Santa Barbara",
"country": "USA",
"slackId": "UPDR80K2Q",
"slackUsername": "Rahul Pratap Singh"
},
{
"name": "Ran-Yu Chang",
"image": "https://dl.airtable.com/.attachmentThumbnails/caecd6af6d8620d5ee6ba6974df2d030/dfde8184",
"region": "Asia",
"city": "Changhua County",
"country": "Taiwan",
"slackId": "U017L9BAWT0",
@ -1596,6 +1684,7 @@
{
"name": "Renata Wong",
"image": "https://dl.airtable.com/.attachmentThumbnails/c85c09ccf72c881b94743f92a876a929/159155cc",
"region": "Europe",
"city": "Warsaw",
"country": "Poland",
"slackId": "US4U904CF",
@ -1604,6 +1693,7 @@
{
"name": "Richard Li",
"image": "https://dl.airtable.com/.attachmentThumbnails/727487950b8eae15efb633c5fc93042f/837ce25c",
"region": "North America",
"city": "New Haven",
"country": "United States",
"slackId": "U01S4NDS404",
@ -1639,6 +1729,7 @@
{
"name": "Rohit Prasad",
"image": "https://dl.airtable.com/.attachmentThumbnails/36b0068d851620705cb64f44950a91d2/55f496af",
"region": "Asia",
"city": "Gaya",
"country": "India",
"slackId": "U02255G2925",
@ -1665,6 +1756,7 @@
{
"name": "Saasha Joshi",
"image": "https://dl.airtable.com/.attachmentThumbnails/bbe2507a3f88a37fc2fded037a56d37a/458ad9a6",
"region": "North America",
"city": "Victoria",
"country": "Canada",
"slackId": "U016XSCU5KM",
@ -1673,6 +1765,7 @@
{
"name": "Sabhyata Gupta",
"image": "https://dl.airtable.com/.attachmentThumbnails/0d7cda3e36e0479e40fb512fa34db149/31f50878",
"region": "Europe",
"city": "Barcelona",
"country": "Spain",
"slackId": "USC4UHDGC",
@ -1690,6 +1783,7 @@
{
"name": "Sahar Ben Rached",
"image": "https://dl.airtable.com/.attachmentThumbnails/e56004b70f99b8aeff74d0ac3c442409/277e31c6",
"region": "Africa",
"city": "Zaghouan",
"country": "Tunisia",
"slackId": "UQYQB8ZS6",
@ -1698,6 +1792,7 @@
{
"name": "Samantha Lang",
"image": "https://dl.airtable.com/.attachmentThumbnails/ef86f5217a92c078a0f44da5a5988e84/ee745be9",
"region": "North America",
"city": "Atlanta",
"country": "United States",
"slackId": "U017BSBT7R9",
@ -1715,6 +1810,7 @@
{
"name": "Sara Metwalli",
"image": "https://dl.airtable.com/.attachmentThumbnails/b1b887dc5e612b61ca7d4487b1ada4f9/2f536896",
"region": "Asia",
"city": "Tokyo",
"country": "Japan",
"slackId": "U01FC847DCP",
@ -1749,6 +1845,7 @@
{
"name": "Sean Wagner",
"image": "https://dl.airtable.com/.attachmentThumbnails/f04d5d8881787efb9a895de6567920dc/b9c5ff7d",
"region": "North America",
"city": "Toronto",
"country": "Canada",
"slackId": "U018U5QGPQA",
@ -1793,6 +1890,7 @@
{
"name": "Shilpa Mahato",
"image": "https://dl.airtable.com/.attachmentThumbnails/dd615931e3e1f51b68841b6d513d3f4a/36b9651a",
"region": "Asia",
"city": "Kolkata",
"country": "India",
"slackId": "U02292R6G8K",
@ -1801,6 +1899,7 @@
{
"name": "Shota Nakasuji",
"image": "https://dl.airtable.com/.attachmentThumbnails/04881e69687abe325ff70578c19e66e5/8c9fd9f5",
"region": "Asia",
"city": "Tokyo",
"country": "Japan",
"slackId": "U0174U64FD4",
@ -1809,6 +1908,7 @@
{
"name": "Siddhartha E Morales Guzman",
"image": "https://dl.airtable.com/.attachmentThumbnails/18f8dc8c2654061d203c6933ccd15d22/6ecfaf11",
"region": "North America",
"city": "San Luis Potosí",
"country": "Mexico",
"slackId": "U01DK5J8S6A",
@ -1817,6 +1917,7 @@
{
"name": "Siyuan Niu",
"image": "https://dl.airtable.com/.attachmentThumbnails/ee1b5a4f1eacfa5d3947f2758637cd08/3f82450c",
"region": "Europe",
"city": "Montpellier",
"country": "France",
"slackId": "URAATS1FE",
@ -1861,6 +1962,7 @@
{
"name": "Srinjoy Ganguly",
"image": "https://dl.airtable.com/.attachmentThumbnails/d865ff8e088d0be0fedb716271abd5e8/ffc1d4e6",
"region": "Asia",
"city": "Ghaziabad",
"country": "India",
"slackId": "U019X279DTK",
@ -1869,6 +1971,7 @@
{
"name": "Stefan Hillmich",
"image": "https://dl.airtable.com/.attachmentThumbnails/9c6a758d5278ca60031d5d67f2a35af6/1db69db3",
"region": "Europe",
"city": "Linz",
"country": "Austria",
"slackId": "UPZ3Z8QP3",
@ -1895,6 +1998,7 @@
{
"name": "Sungjoo(Dennis) Hwang",
"image": "https://dl.airtable.com/.attachmentThumbnails/52a36b7897daceeaf126b09f9df1da21/35bcfa30",
"region": "Asia",
"city": "Suwon-si",
"country": "South Korea",
"slackId": "U021UM9QY1H",
@ -1912,6 +2016,7 @@
{
"name": "Syed Farhan Ahmad",
"image": "https://dl.airtable.com/.attachmentThumbnails/8292d4c74b1b63d5635802759ee664fe/ae34f5b4",
"region": "Asia",
"city": "Bangalore",
"country": "India",
"slackId": "U018L2GUV4L",
@ -1929,6 +2034,7 @@
{
"name": "Tai Yue Li",
"image": "https://dl.airtable.com/.attachmentThumbnails/740d191c02595166a123bc5fc1eddfb2/d33f97a4",
"region": "Asia",
"city": "Hualien",
"country": "Taiwan",
"slackId": "U019Y7VNGMR",
@ -1937,6 +2043,7 @@
{
"name": "Tanya Garg",
"image": "https://dl.airtable.com/.attachmentThumbnails/8d43ea7ce4a77e68bb3ed3ab9f9fcc90/65333910",
"region": "Asia",
"city": "Delhi",
"country": "India",
"slackId": "U017C3TJGGK",
@ -1963,6 +2070,7 @@
{
"name": "Vaibhav Jain",
"image": "https://dl.airtable.com/.attachmentThumbnails/44c86f04a0366aa8486c1c2b4c7feb9e/dff35630",
"region": "Europe",
"city": "Bristol",
"country": "United Kingdom",
"slackId": "U01EGPDMD88",
@ -1971,6 +2079,7 @@
{
"name": "VED DHARKAR",
"image": "https://dl.airtable.com/.attachmentThumbnails/6510d3fd7e1e2f59dd42f257fb4597b8/b2ab6c6f",
"region": "Asia",
"city": "NAGPUR",
"country": "India",
"slackId": "U014MA8HKAS",
@ -1988,6 +2097,7 @@
{
"name": "Vishal Sharathchandra Bajpe",
"image": "https://dl.airtable.com/.attachmentThumbnails/b782d51240427af21753256631560edd/e49b9271",
"region": "Asia",
"city": "Mumbai",
"country": "India",
"slackId": "U0192MBHN11",
@ -1996,6 +2106,7 @@
{
"name": "Vishnu Ajith",
"image": "https://dl.airtable.com/.attachmentThumbnails/34c8f4a37e7d56b098a02a6001740f44/fba50d25",
"region": "Asia",
"city": "Kochi",
"country": "India",
"slackId": "U013W8V2B5E",
@ -2022,6 +2133,7 @@
{
"name": "Winona Murphy",
"image": "https://dl.airtable.com/.attachmentThumbnails/7c5cf2c1a6a7388f8646e3de20acf4b1/c334a054",
"region": "North America",
"city": "Valhalla",
"country": "United States",
"slackId": "U017SQH4E21",
@ -2046,6 +2158,7 @@
{
"name": "Yulun Wang",
"image": "https://dl.airtable.com/.attachmentThumbnails/721e3b692c48eb5e5f7691fddb57f2e0/fdc3029d",
"region": "North America",
"city": "Stony Brook",
"country": "United States",
"slackId": "UAGGK5WSC",
@ -2072,6 +2185,7 @@
{
"name": "Zhixin(Jack) Song",
"image": "https://dl.airtable.com/.attachmentThumbnails/8e5e2d1b0c19fb41f02e712e212e962a/a055f8fa",
"region": "North America",
"city": "Atlanta",
"country": "United States",
"slackId": "U014NA2BGRJ",

View File

@ -1 +1,32 @@
[]
[
{
"title": "APS March Meeting",
"types": [
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/ca3816d9f65dcfb13aa050da7d9e7785/7c6866fd",
"location": "Chicago, IL",
"regions": [
"North America"
],
"date": "March 14-18, 2022",
"startDate": "2022-03-14",
"endDate": "2022-03-18",
"to": "https://march.aps.org"
},
{
"title": "QIP 2022",
"types": [
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/ca3816d9f65dcfb13aa050da7d9e7785/7c6866fd",
"location": "California Institute of Technology",
"regions": [
"North America"
],
"date": "March 7-11, 2022",
"startDate": "2022-03-07",
"endDate": "2022-03-11",
"to": "https://qipconference.org/nextqip"
}
]

View File

@ -1,20 +1,46 @@
[
{
"date": "December 3, 2021",
"image": "https://dl.airtable.com/.attachmentThumbnails/787f0331b79b91bd47d1afa335334b61/e0d8bd31",
"institution": "Unitary Fund",
"date": "February 25, 2022",
"startDate": "2022-02-25",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/332b133c2ee74c3792bf25938b4fa5ea/834e80c0",
"institution": "University of Rochester",
"location": "YouTube",
"speaker": "Andrea Mari",
"title": "Seminar Series: Digital Error Mitigation with Mitiq",
"to": "https://youtu.be/QK3Vkn2MCCg"
"speaker": "Machiel Blok",
"title": "Seminar Series with Machiel Blok",
"to": "https://youtu.be/sl0rQsg8x7o"
},
{
"date": "November 19, 2021",
"image": "https://dl.airtable.com/.attachmentThumbnails/4588bb39230015f1ad5a9c4595b8ca16/94603c57",
"institution": "UMass Amherst",
"date": "February 18, 2022",
"startDate": "2022-02-18",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/e635d12d3eb4ce35e0bce427395b8f30/0ba4d5d0",
"institution": "University of Chicago",
"location": "YouTube",
"speaker": "Chen Wang",
"title": "Seminar Series: Autonomous Quantum Error Correction in a Bosonic Qubit with Chen Wang",
"to": "https://youtu.be/q4wOhKNxDxs"
"speaker": "Hannes Bernien",
"title": "Seminar Series: Engineering Quantum Processors and Quantum Networks Atom-by-Atom",
"to": "https://youtu.be/mnGPrD5qlX4"
},
{
"date": "February 4, 2022",
"startDate": "2022-02-04",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/ecec0a6e59809318eb40733d20a472ab/d04f8089",
"institution": "QuICS, NIST, University of Maryland",
"location": "YouTube",
"speaker": "Nicole Yunger Halpern",
"title": "Seminar Series: Linear Growth of Quantum Circuit Complexity",
"to": "https://youtu.be/maT-dget9uM"
},
{
"date": "January 28, 2022",
"startDate": "2022-01-28",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/758b84fac6ee86dde6548f847d7c7ce8/bfcb6231",
"institution": "NIST",
"location": "YouTube",
"speaker": "Florent Q. Lecocq",
"title": "Seminar Series: Microwave Amplifiers for Quantum Information Processing",
"to": "https://youtu.be/sVRWtSv0boc"
}
]

View File

@ -1,54 +1,77 @@
[
{
"title": "Seminar Series: Universal control using the quantum Zeno effect",
"title": "Seminar Series: Material Defects in Superconducting Quantum Computers",
"types": [
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/bc98ab335446f6319f06a4a12e0b8acb/de1b23d2",
"image": "https://dl.airtable.com/.attachmentThumbnails/dc35eca3cdb2e97ea8092b4e91ca5319/14130ba7",
"location": "YouTube",
"regions": [
"TBD"
],
"date": "January 21, 2022",
"to": "https://youtu.be/4Sucx6BOl4w"
"date": "April 8, 2022",
"startDate": "2022-04-08",
"endDate": "",
"to": "https://youtu.be/GZ3s561LRyM"
},
{
"title": "Seminar Series with Florent Q. Lecocq",
"title": "Seminar Series with Jens Koch",
"types": [
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/758b84fac6ee86dde6548f847d7c7ce8/bfcb6231",
"image": "https://dl.airtable.com/.attachmentThumbnails/a805afd7b59434f2c549698841832838/9d50444e",
"location": "YouTube",
"regions": [
"TBD"
],
"date": "January 28, 2022",
"to": "https://youtu.be/sVRWtSv0boc"
"date": "April 15, 2022",
"startDate": "2022-04-15",
"endDate": "",
"to": "https://youtu.be/MLZFbYaAn7E"
},
{
"title": "MIT iQuHack 2022",
"title": "Seminar Series with Artur Izmaylov",
"types": [
"Hackathon"
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/f16607d9fa40d4200f1dea0392651ed7/21e939fd",
"location": "Boston, MA",
"image": "https://dl.airtable.com/.attachmentThumbnails/787d140fa9505f3854c4068256c21009/4db2b27e",
"location": "YouTube",
"regions": [
"North America"
"TBD"
],
"date": "January 28-30, 2022",
"to": "https://www.iquise.mit.edu/iQuHACK/2022-01-28"
"date": "April 22, 2022",
"startDate": "2022-04-22",
"endDate": "",
"to": "https://youtu.be/7aI0pLRYby4"
},
{
"title": "Qiskit Hackathon Korea",
"title": "Qiskit Hackathon at World of Quantum",
"types": [
"Hackathon"
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/d1234b87fb7a26653e42186d5780f4b1/6312034b",
"location": "TBD",
"image": "https://dl.airtable.com/.attachmentThumbnails/49b75ff56895af05201153bdf24754b3/15cb95b1",
"location": "Munich, Germany",
"regions": [
"Asia Pacific"
"Europe"
],
"date": "February 7-10, 2022",
"to": "https://qiskithackkorea.creatorlink.net/"
"date": "April 26-27, 2022",
"startDate": "2022-04-26",
"endDate": "2022-04-27",
"to": "https://world-of-photonics.com/en/supporting-program/action/hackathon/"
},
{
"title": "Seminar Series: The Most Important Graph(s) in Quantum Error-Correction",
"types": [
"Talks"
],
"image": "https://dl.airtable.com/.attachmentThumbnails/66ba722ea32fe8fded52ec344e209e60/c8645c82",
"location": "YouTube",
"regions": [
"TBD"
],
"date": "April 29, 2022",
"startDate": "2022-04-29",
"endDate": "",
"to": "https://youtu.be/IcOALcllPEo"
}
]

View File

@ -1,20 +1,46 @@
[
{
"date": "January 21, 2022",
"image": "https://dl.airtable.com/.attachmentThumbnails/bc98ab335446f6319f06a4a12e0b8acb/de1b23d2",
"institution": "Israel Institute of Technology",
"date": "April 8, 2022",
"startDate": "2022-04-08",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/dc35eca3cdb2e97ea8092b4e91ca5319/14130ba7",
"institution": "Physikalisches Institut, Karlsruher Institut für Technologie (KIT), Karlsruhe",
"location": "YouTube",
"speaker": "Shay Hacohen-Gourgy",
"title": "Seminar Series: Universal control using the quantum Zeno effect",
"to": "https://youtu.be/4Sucx6BOl4w"
"speaker": "Jürgen Lisenfeld",
"title": "Seminar Series: Material Defects in Superconducting Quantum Computers",
"to": "https://youtu.be/GZ3s561LRyM"
},
{
"date": "January 28, 2022",
"image": "https://dl.airtable.com/.attachmentThumbnails/758b84fac6ee86dde6548f847d7c7ce8/bfcb6231",
"institution": "NIST",
"date": "April 15, 2022",
"startDate": "2022-04-15",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/a805afd7b59434f2c549698841832838/9d50444e",
"institution": "Northwestern",
"location": "YouTube",
"speaker": "Florent Q. Lecocq",
"title": "Seminar Series with Florent Q. Lecocq",
"to": "https://youtu.be/sVRWtSv0boc"
"speaker": "Jens Koch",
"title": "Seminar Series with Jens Koch",
"to": "https://youtu.be/MLZFbYaAn7E"
},
{
"date": "April 22, 2022",
"startDate": "2022-04-22",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/787d140fa9505f3854c4068256c21009/4db2b27e",
"institution": "University of Toronto",
"location": "YouTube",
"speaker": "Artur Izmaylov",
"title": "Seminar Series with Artur Izmaylov",
"to": "https://youtu.be/7aI0pLRYby4"
},
{
"date": "April 29, 2022",
"startDate": "2022-04-29",
"endDate": "",
"image": "https://dl.airtable.com/.attachmentThumbnails/66ba722ea32fe8fded52ec344e209e60/c8645c82",
"institution": "IBM Research",
"location": "YouTube",
"speaker": "Ted Yoder",
"title": "Seminar Series: The Most Important Graph(s) in Quantum Error-Correction",
"to": "https://youtu.be/IcOALcllPEo"
}
]

View File

@ -17,6 +17,8 @@ import {
type SeminarSeriesEvent = {
date: string,
startDate: string,
endDate: string,
image: string,
institution: string,
location: string,
@ -43,14 +45,7 @@ const RECORD_FIELDS = Object.freeze({
function getEventsQuery (apiKey: string, days: number, view: string, filters: string[] = []): Airtable.Query<{}> {
const { startDate } = RECORD_FIELDS
const base = new Airtable({ apiKey }).base('appYREKB18uC7y8ul')
const formulaFilters = [
`DATETIME_DIFF({${startDate}}, TODAY(), 'days') ${days > 0 ? '<=' : '>='} ${days}`,
`DATETIME_DIFF({${startDate}}, TODAY(), 'days') ${days > 0 ? '>=' : '<'} 0`,
...filters
]
const filterByFormula = `AND(${formulaFilters.join(',')})`
const filterByFormula = `AND(${filters})`
return base('Event Calendar').select({
filterByFormula,
@ -59,6 +54,53 @@ function getEventsQuery (apiKey: string, days: number, view: string, filters: st
})
}
/**
* Check whether an event happens within a predetermined number of days before
* or after today.
* If the "days" parameter is positive, the event must happen in the future,
* between today and the given number of days after today.
* If the "days" parameter is negative, the event must happen in the past,
* between today and the given number of days before today.
* @param event The event to check.
* @param days The number of days before and after today.
* @returns Whether the event happens within the specified range.
*/
function isEventInDateRange (
event: CommunityEvent | SeminarSeriesEvent,
days: number
): boolean {
const { startDate, endDate } = event
const today: Date = new Date()
const eventStartDate: Date = new Date(startDate)
const eventEndDate: Date = new Date(endDate)
const isFutureRange: boolean = days > 0
let eventDateToCheck: Date
// Determine which date to check based on the days parameter and checking if
// the event's dates are valid.
if (!isFutureRange && !isNaN(eventEndDate.getTime())) {
eventDateToCheck = eventEndDate
} else if (!isNaN(eventStartDate.getTime())) {
eventDateToCheck = eventStartDate
} else {
return false
}
let rangeStart: Date
let rangeEnd: Date
// Determine the range of dates to check.
if (isFutureRange) {
rangeStart = new Date(today)
rangeEnd = new Date(today.getTime() + days * 24 * 60 * 60 * 1000)
} else {
rangeStart = new Date(today.getTime() + days * 24 * 60 * 60 * 1000)
rangeEnd = new Date(today)
}
return eventDateToCheck >= rangeStart && eventDateToCheck <= rangeEnd
}
async function fetchCommunityEvents (apiKey: string, { days }: { days: any }): Promise<CommunityEvent[]> {
const { showOnEventsPage } = RECORD_FIELDS
const communityEvents: CommunityEvent[] = []
@ -66,7 +108,9 @@ async function fetchCommunityEvents (apiKey: string, { days }: { days: any }): P
await getEventsQuery(apiKey, days, 'Add to Event Site', [`{${showOnEventsPage}}`]).eachPage((records, nextPage) => {
for (const record of records) {
const communityEvent = convertToCommunityEvent(record)
communityEvents.push(communityEvent)
if (isEventInDateRange(communityEvent, days)) {
communityEvents.push(communityEvent)
}
}
nextPage()
})
@ -83,7 +127,9 @@ async function fetchSeminarSeriesEvents (apiKey: string, { days }: { days: any }
const seminarSeriesEvent = convertToSeminarSeriesEvent(record)
if (typeof (seminarSeriesEvent.to) !== 'undefined') {
seminarSeriesEvents.push(seminarSeriesEvent)
if (isEventInDateRange(seminarSeriesEvent, days)) {
seminarSeriesEvents.push(seminarSeriesEvent)
}
}
}
nextPage()
@ -100,6 +146,8 @@ function convertToCommunityEvent (record: any): CommunityEvent {
location: getLocation(record),
regions: getRegions(record),
date: formatDates(...getDates(record)),
startDate: getStartDate(record),
endDate: getEndDate(record),
to: getWebsite(record)
}
}
@ -107,6 +155,8 @@ function convertToCommunityEvent (record: any): CommunityEvent {
function convertToSeminarSeriesEvent (record: any): SeminarSeriesEvent {
return {
date: formatDates(...getDates(record)),
startDate: getStartDate(record),
endDate: getEndDate(record),
image: getImage(record),
institution: getInstitution(record),
location: getLocation(record),
@ -157,6 +207,14 @@ function getRegions (record: any): WorldRegion[] {
return recordRegion || [WORLD_REGIONS.tbd]
}
function getStartDate (record: any): string {
return record.get(RECORD_FIELDS.startDate) || ''
}
function getEndDate (record: any): string {
return record.get(RECORD_FIELDS.endDate) || ''
}
function getDates (record: any): [Date, Date|undefined] {
const recordStartDate = record.get(RECORD_FIELDS.startDate)
const recordEndDate = record.get(RECORD_FIELDS.endDate)
@ -212,5 +270,6 @@ export {
getDates,
formatDates,
filterWithWhitelist,
isEventInDateRange,
SeminarSeriesEvent
}

View File

@ -35,6 +35,8 @@ type CommunityEvent = {
location: string,
regions: WorldRegion[],
date: string,
startDate: string,
endDate: string,
to: string
}

View File

@ -7,10 +7,12 @@ import {
getLocation,
getRegions,
getDates,
getImage
getImage,
isEventInDateRange
} from '~/hooks/event-conversion-utils'
import { COMMUNITY_EVENT_TYPES, WORLD_REGIONS } from '~/store/events'
import type { CommunityEvent } from '~/store/events'
type RecordFields = {
name: string,
@ -44,6 +46,97 @@ class FakeRecord {
}
}
describe('isEventInDateRange', () => {
const mockEventBase = {
types: [],
title: '',
image: '',
location: '',
regions: [],
date: '',
to: ''
}
const getFormattedDate = (daysOffset: number): string => {
let date = new Date()
// Correct for timezone offset
date = new Date(date.getTime() - (date.getTimezoneOffset() * 60 * 1000))
// Add days offset
date.setDate(date.getDate() + daysOffset)
// Return date in YYYY-MM-DD format
return date.toISOString().split('T')[0]
}
let mockEvent: CommunityEvent
it('returns true if the event happens within the next 15 days', () => {
const days = 15
// Event happened in the past
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(-7),
endDate: getFormattedDate(-1)
}
expect(isEventInDateRange(mockEvent, days)).toBe(false)
// Event starts within the next 15 days
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(7),
endDate: ''
}
expect(isEventInDateRange(mockEvent, days)).toBe(true)
// Event starts within the next 15 days and ends after 15 days
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(7),
endDate: getFormattedDate(20)
}
expect(isEventInDateRange(mockEvent, days)).toBe(true)
// Event starts in exactly 15 days
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(15),
endDate: ''
}
expect(isEventInDateRange(mockEvent, days)).toBe(true)
})
it('returns true if the event happened within the last 15 days', () => {
const days = -15
// Event happened before the last 15 days
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(-100),
endDate: getFormattedDate(-20)
}
expect(isEventInDateRange(mockEvent, days)).toBe(false)
// Event started before the last 15 days and ended within the last 15 days
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(-100),
endDate: getFormattedDate(-7)
}
expect(isEventInDateRange(mockEvent, days)).toBe(true)
// Event starts in the future
mockEvent = {
...mockEventBase,
startDate: getFormattedDate(7),
endDate: ''
}
expect(isEventInDateRange(mockEvent, days)).toBe(false)
})
})
describe('convertToCommunityEvent', () => {
const { hackathon } = COMMUNITY_EVENT_TYPES
const { europe } = WORLD_REGIONS