The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const isTimeRangeDateGranularity = (
granularity?: ObjectRecordGroupByDateGranularity | null,
): boolean => {
if (!isDefined(granularity)) return false;
return [
ObjectRecordGroupByDateGranularity.WEEK,
ObjectRecordGroupByDateGranularity.MONTH,
ObjectRecordGroupByDateGranularity.QUARTER,
ObjectRecordGroupByDateGranularity.YEAR,
].includes(granularity);
};