@nathanwallrus you can add a column named numberId.
In each collection fill in the number in the order you wish them to be available: 1,2,3,4,etc…
You can go to the backend/data.js
And create there an beforeInsert and beforeUpdate hooks that update the startDate and expirationDate based on the numberId value like:
//in backend/data.js
function getItemWithDates(item){
const dates = {
'1':{
start: new Date('March 17, 2022 05:30:00'),
end: new Date('March 18, 2022 05:30:00'),
},
'2':{
start: new Date('March 20, 2022 05:30:00'),
end: new Date('March 30, 2022 05:30:00')
},
//etc..
};
if((item.startDate && item.expirationDate) || !item.numberId){return item;}
const numStr = item.numberId.toTring();
item.startDate = dates[numStr].start;
item.expirationDate = dates[numStr].end;
return item;
}
const collection1_beforeInsert = (item) => getItemWithDates(item);
const collection1_beforeUpdate = (item) => getItemWithDates(item);
const collection2_beforeInsert = (item) => getItemWithDates(item);
const collection2_beforeUpdate = (item) => getItemWithDates(item);