Add DziennikDataOd and DziennikDataDo fields to UczenDziennik endpoint

This commit is contained in:
Mikołaj Pich 2021-12-30 17:42:20 +01:00
parent f40c03b3d2
commit 2a67b6de1f

View file

@ -6,7 +6,18 @@ const converter = require('../utils/converter');
const Tokens = require('csrf');
const _ = require('lodash');
const {getGradeColorByCategoryName} = require("../utils/gradeColor");
const { format, fromUnixTime, getYear, addYears, addMonths, addDays, subDays, differenceInDays, parseISO, startOfWeek } = require('date-fns');
const {
format,
fromUnixTime,
getYear,
addYears,
addMonths,
addDays,
subDays,
differenceInDays,
parseISO,
startOfWeek
} = require('date-fns');
router.get("/", (req, res) => {
const base = protocol(req) + "://" + req.get('host') + "/powiatwulkanowy/123456";
@ -132,6 +143,8 @@ router.all("/UczenDziennik.mvc/Get", (req, res) => {
Id: semesterId
};
}),
DziennikDataOd: format(addMonths(item.OkresDataOd, 0), 'yyyy-MM-dd HH:mm:ss'),
DziennikDataDo: format(addMonths(item.OkresDataDo, 7), 'yyyy-MM-dd HH:mm:ss'),
"IdSioTyp": 11,
"IsDorosli": false,
"IsPolicealna": false,