You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do timescales through pure functions which create regexes for timestamps and filter that way
function returns a generated validator(): bool for 'this month', then filter data: data.filter(validator). Internally, it more or less runs const validator = s => /^2020/.test(s).
This month - /^2020-05/.test(timestamp)
Last 90 days - this can be done with regex but it should return a function which does some more involved logic and returns boolean (for filtering)
Last 6 months - /^2020/.test(timestamp)
This year - /^2020/.test(timestamp)
Last year - /^2019/.test(timestamp) (this year - 1)
All-time - true
The text was updated successfully, but these errors were encountered:
Do timescales through pure functions which create regexes for timestamps and filter that way
function returns a generated
validator(): bool
for 'this month', then filter data:data.filter(validator)
. Internally, it more or less runsconst validator = s => /^2020/.test(s)
./^2020-05/.test(timestamp)
/^2020/.test(timestamp)
/^2020/.test(timestamp)
/^2019/.test(timestamp)
(this year - 1)The text was updated successfully, but these errors were encountered: