mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-30 19:09:48 -06:00
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com> Co-authored-by: Johannes <johannes@formbricks.com>
8 lines
289 B
TypeScript
8 lines
289 B
TypeScript
// utility functions for date and time
|
|
|
|
// Helper function to calculate difference in days between two dates
|
|
export const diffInDays = (date1: Date, date2: Date) => {
|
|
const diffTime = Math.abs(date2.getTime() - date1.getTime());
|
|
return Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
|
};
|