-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hello, i'm trying to get the lessons list from specific day to today, but it fails
Error: Parametr dateFrom/dateToma nieprawidłową wartość2024-00-We/2024-05-Tu`
at Api.request (D:\Nodev2\vulcanjs\node_modules.pnpm\vulcan-api-js@3.5.3\node_modules\vulcan-api-js\lib\index.cjs:86004:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Api.get (D:\Nodev2\vulcanjs\node_modules.pnpm\vulcan-api-js@3.5.3\node_modules\vulcan-api-js\lib\index.cjs:86022:14)
at async ApiHelper.getList (D:\Nodev2\vulcanjs\node_modules.pnpm\vulcan-api-js@3.5.3\node_modules\vulcan-api-js\lib\index.cjs:84159:12)
at async VulcanHebe.getLessons (D:\Nodev2\vulcanjs\node_modules.pnpm\vulcan-api-js@3.5.3\node_modules\vulcan-api-js\lib\index.cjs:86177:18)
at async Object.run (D:\Nodev2\vulcanjs\modules\lessons.js:17:19)
Node.js v18.15.0`
code:
async run(args) {
if (!fs.existsSync('./auth/keystore.json') || !fs.existsSync('./auth/account.json')) return console.log('No account or keystore found, please register first');
const keystore = new Keystore();
keystore.loadFromJsonString(fs.readFileSync('./auth/keystore.json', { encoding: 'utf-8' }));
const client = new VulcanHebe(keystore, AccountTools.loadFromJsonString(fs.readFileSync('./auth/account.json', { encoding: 'utf-8' })));
// student selection
await client.selectStudent(student());
// lessons
const datearg = args[0];
const date = datearg ? new Date(datearg) : new Date();
const lessons = await client.getLessons(date, new Date());
console.log(lessons);
},