Skip to content

Commit

Permalink
variable year&month for the time-off data
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesDuboisSAP committed Aug 4, 2020
1 parent 2542176 commit 73ee943
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ app.use(sendFakeCsrfToken)
app.use('/sap/opu/odata/sap/API_BUSINESS_PARTNER', bupaApi);
app.use('/sap/opu/odata/sap/YY1_BPSOCIALMEDIA_CDS', socialMediaApi);
app.use('/sap/opu/odata/sap/API_MANAGE_WORKFORCE_TIMESHEET', timeSheetApi);
app.use('/sap/opu/odata/sap/ECTimeOff', timeOff);
app.use('/odata/v2', timeOff);

app.get('/', function(req, res) {
res.set('Content-Type', 'text/html');
Expand All @@ -35,7 +35,7 @@ app.get('/', function(req, res) {
<div>OData mock service for Business Partner API of SAP S/4HANA Cloud is running at <a href="/sap/opu/odata/sap/API_BUSINESS_PARTNER">/sap/opu/odata/sap/API_BUSINESS_PARTNER</a>.</div>
<div>OData mock service for Business Partner Social Media custom API is running at <a href="/sap/opu/odata/sap/YY1_BPSOCIALMEDIA_CDS">/sap/opu/odata/sap/YY1_BPSOCIALMEDIA_CDS</a>.</div>
<div>OData mock service for Timesheet API is running at <a href="/sap/opu/odata/sap/API_MANAGE_WORKFORCE_TIMESHEET">/sap/opu/odata/sap/API_MANAGE_WORKFORCE_TIMESHEET</a>.</div>
<div>OData mock service for Time off API is running at <a href="/sap/opu/odata/sap/ECTimeOff">/sap/opu/odata/sap/ECTimeOff</a>.</div>
<div>OData mock service for Employee Central Time Off service of SAP SuccessFactors is running at <a href="/odata/v2/EmployeeTime">/odata/v2/EmployeeTime</a>.</div>
</body>
</html>`);
});
Expand Down
26 changes: 14 additions & 12 deletions time-off/employee-time.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const moment = require('moment');
const yearMonth = moment().format('YYYY.MM');
module.exports = [
{
__metadata: {
Expand All @@ -7,7 +9,7 @@ module.exports = [
},
externalCode: "49a86b2e29424dfe94041cc098cdbb77",
lastModifiedDateTime: "/Date(1564148716000+0000)/",
endDate: "/Date(1568937600000)/",
endDate: `/Date(${new Date( moment(1568937600000).format(yearMonth + ".DD") ).getTime()})/`,
loaActualReturnDate: null,
mdfSystemEffectiveEndDate: "/Date(253402214400000)/",
createdDateTime: "/Date(1564148716000+0000)/",
Expand All @@ -20,7 +22,7 @@ module.exports = [
mdfSystemRecordStatus: "N",
quantityInHours: "24",
loaStartJobInfoId: null,
startDate: "/Date(1568851200000)/",
startDate: `/Date(${new Date( moment(1568851200000).format(yearMonth + ".DD") ).getTime()})/`,
displayQuantity: "3",
quantityInDays: "3",
mdfSystemEffectiveStartDate: "/Date(-2208988800000)/",
Expand Down Expand Up @@ -147,7 +149,7 @@ module.exports = [
},
externalCode: "49a86b2e29424dfe94041cc098cdbb76",
lastModifiedDateTime: "/Date(1564148716000+0000)/",
endDate: "/Date(1569369600000)/",
endDate: `/Date(${new Date( moment(1569369600000).format(yearMonth + ".DD") ).getTime()})/`,
loaActualReturnDate: null,
mdfSystemEffectiveEndDate: "/Date(253402214400000)/",
createdDateTime: "/Date(1564148716000+0000)/",
Expand All @@ -160,7 +162,7 @@ module.exports = [
mdfSystemRecordStatus: "N",
quantityInHours: "24",
loaStartJobInfoId: null,
startDate: "/Date(1569196800000)/",
startDate: `/Date(${new Date( moment(1569196800000).format(yearMonth + ".DD") ).getTime()})/`,
displayQuantity: "3",
quantityInDays: "3",
mdfSystemEffectiveStartDate: "/Date(-2208988800000)/",
Expand Down Expand Up @@ -287,7 +289,7 @@ module.exports = [
},
externalCode: "a2dfb4efaff64fd89607576ad7dcc66b",
lastModifiedDateTime: "/Date(1564148786000+0000)/",
endDate: "/Date(1570492800000)/",
endDate: `/Date(${new Date( moment(1570492800000).format(yearMonth + ".DD") ).getTime()})/`,
loaActualReturnDate: null,
mdfSystemEffectiveEndDate: "/Date(253402214400000)/",
createdDateTime: "/Date(1564148786000+0000)/",
Expand All @@ -300,7 +302,7 @@ module.exports = [
mdfSystemRecordStatus: "N",
quantityInHours: "16",
loaStartJobInfoId: null,
startDate: "/Date(1570406400000)/",
startDate: `/Date(${new Date( moment(1570406400000).format(yearMonth + ".DD") ).getTime()})/`,
displayQuantity: "2",
quantityInDays: "2",
mdfSystemEffectiveStartDate: "/Date(-2208988800000)/",
Expand Down Expand Up @@ -427,7 +429,7 @@ module.exports = [
},
externalCode: "f31ddaada6bb42a687050e677fee48cd",
lastModifiedDateTime: "/Date(1564148836000+0000)/",
endDate: "/Date(1573603200000)/",
endDate: `/Date(${new Date( moment(1573603200000).format(yearMonth + ".DD") ).getTime()})/`,
loaActualReturnDate: null,
mdfSystemEffectiveEndDate: "/Date(253402214400000)/",
createdDateTime: "/Date(1564148836000+0000)/",
Expand All @@ -440,7 +442,7 @@ module.exports = [
mdfSystemRecordStatus: "N",
quantityInHours: "16",
loaStartJobInfoId: null,
startDate: "/Date(1573516800000)/",
startDate: `/Date(${new Date( moment(1573516800000).format(yearMonth + ".DD") ).getTime()})/`,
displayQuantity: "2",
quantityInDays: "2",
mdfSystemEffectiveStartDate: "/Date(-2208988800000)/",
Expand Down Expand Up @@ -567,7 +569,7 @@ module.exports = [
},
externalCode: "3fdd3186860345f5a8cd0af88825e192",
lastModifiedDateTime: "/Date(1568106966000+0000)/",
endDate: "/Date(1566345600000)/",
endDate: `/Date(${new Date( moment(1566345600000).format(yearMonth + ".DD") ).getTime()})/`,
loaActualReturnDate: null,
mdfSystemEffectiveEndDate: "/Date(253402214400000)/",
createdDateTime: "/Date(1568106966000+0000)/",
Expand All @@ -580,7 +582,7 @@ module.exports = [
mdfSystemRecordStatus: "N",
quantityInHours: "24",
loaStartJobInfoId: null,
startDate: "/Date(1566172800000)/",
startDate: `/Date(${new Date( moment(1566172800000).format(yearMonth + ".DD") ).getTime()})/`,
displayQuantity: "3",
quantityInDays: "3",
mdfSystemEffectiveStartDate: "/Date(-2208988800000)/",
Expand Down Expand Up @@ -707,7 +709,7 @@ module.exports = [
},
externalCode: "f4904b0cb74b4581a4ad7fbe836f7602",
lastModifiedDateTime: "/Date(1568185250000+0000)/",
endDate: "/Date(1566345600000)/",
endDate: `/Date(${new Date( moment(1566345600000).format(yearMonth + ".DD") ).getTime()})/`,
loaActualReturnDate: null,
mdfSystemEffectiveEndDate: "/Date(253402214400000)/",
createdDateTime: "/Date(1568185250000+0000)/",
Expand All @@ -720,7 +722,7 @@ module.exports = [
mdfSystemRecordStatus: "N",
quantityInHours: "24",
loaStartJobInfoId: null,
startDate: "/Date(1566172800000)/",
startDate: `/Date(${new Date( moment(1566172800000).format(yearMonth + ".DD") ).getTime()})/`,
displayQuantity: "3",
quantityInDays: "3",
mdfSystemEffectiveStartDate: "/Date(-2208988800000)/",
Expand Down

0 comments on commit 73ee943

Please sign in to comment.