I've assigned two dayjs date values to global variables Vars.date.
var dayjs = require("dayjs") for import
Vars.date1 = dayjs(whateverdate1("add", 2)).format('MMM D, YYYY')
Vars.date2 = dayjs(whateverdate2("add", 2)).format('MMM D, YYYY')
const date1 = Vars.date1
const date2 = Vars.date2
let diff = date1.diff(date2, 'month')
console.log('diff' + diff)
Error: TypeError: date1.diff is not a function
I seem to be unable to access the diff and get methods, always showing 'not a function'
What have I overlooked?