Question:
Greetings fellow developers,
I’m facing an issue when inserting an object with a date via the Wix database jobs config. The data is stored as a ‘string,’ but it should be an ‘object’ of the date type. I’m not sure what’s happening; I spoke with a friend, and he mentioned having the same problem. Does anyone know why this occurs? Is anyone else experiencing the same issue?
Thank you for your attention.
image 1 - Problem
the code
const actualDate = new Date();
actualDate.setMinutes(actualDate.getMinutes() - actualDate.getTimezoneOffset() - 180);
const competenceDate = new Date(actualDate.getFullYear(), actualDate.getMonth(), 0, 23, 59, 59, 999);
const paymentDate = new Date(actualDate);
paymentDate.setDate(10);
const testNewDateCompetenceDate = new Date(competenceDate);
const testNewDatePaymentDate = new Date(paymentDate);
const insert = {
"id": item._id,
"compenteceDate": testNewDateCompetenceDate,
"paymentDate": testNewDatePaymentDate,
"status": "pending"
};
{
"functionLocation": "/location/functionFile.jsw",
"functionName": "FunctionName",
"description": "Description here",
"executionConfig": {
"time": "13:15",
"dateInMonth": 3
}
},