Public
Edited
May 30, 2023
Insert cell
Insert cell
filter = "'Creation Date'<May 23, 2023 10:31 pm AND 'Modified Date':May 20, 2023 10:31 pm TO June 20, 2024 10:31 pm"
Insert cell
algolia_regex_date_range_start = /(: *)\b(January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)( \d{1,2}, \d{4} \d{1,2}:\d{2} [ap]m)\b( *TO)/gi
Insert cell
algolia_regex_date_range_end = /(TO *)\b(January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)( \d{1,2}, \d{4} \d{1,2}:\d{2} [ap]m)\b( *)/gi
Insert cell
algolia_regex_date_comparison = /(=|>|<)( *)\b(January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)( \d{1,2}, \d{4} \d{1,2}:\d{2} [ap]m)\b( *)/gi
Insert cell
filter.replace(algolia_regex_date_range_start, (full_match, prefix, month, day_year_hour_minute, postfix) => {
return ':' + new Date(month + day_year_hour_minute).getTime().toString() + ' TO'
}).replace(algolia_regex_date_range_end, (full_match, prefix, month, day_year_hour_minute, postfix) => {
return 'TO ' + new Date(month + day_year_hour_minute).getTime().toString() + ' '
}).replace(algolia_regex_date_comparison, (full_match, prefix, leading_white_space, month, day_year_hour_minute, postfix) => {
return prefix + new Date(month + day_year_hour_minute).getTime().toString() + ' '
})
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more