Add date and time to contribution details
This commit is contained in:
parent
cbefc1a2b7
commit
a5282875cc
7
index.js
7
index.js
@ -109,8 +109,9 @@ async function initializeKredits () {
|
|||||||
|
|
||||||
async function generateContributionData(reviews, Contributor) {
|
async function generateContributionData(reviews, Contributor) {
|
||||||
const contributors = await Contributor.all();
|
const contributors = await Contributor.all();
|
||||||
|
|
||||||
const contributionData = {};
|
const contributionData = {};
|
||||||
|
const now = (new Date()).toISOString().split('.')[0]+"Z";
|
||||||
|
[date, time] = now.split('T');
|
||||||
|
|
||||||
function addContributionDataForPlatform(platform) {
|
function addContributionDataForPlatform(platform) {
|
||||||
for (const [username, platformReviews] of Object.entries(reviews[platform])) {
|
for (const [username, platformReviews] of Object.entries(reviews[platform])) {
|
||||||
@ -135,8 +136,10 @@ async function generateContributionData(reviews, Contributor) {
|
|||||||
contributionData[contributor.name] = {
|
contributionData[contributor.name] = {
|
||||||
contributorId: contributor.id,
|
contributorId: contributor.id,
|
||||||
contributorIpfsHash: contributor.ipfsHash,
|
contributorIpfsHash: contributor.ipfsHash,
|
||||||
kind: 'dev',
|
date,
|
||||||
|
time,
|
||||||
amount: kreditsAmount,
|
amount: kreditsAmount,
|
||||||
|
kind: 'dev',
|
||||||
description: 'PR reviews',
|
description: 'PR reviews',
|
||||||
details: {
|
details: {
|
||||||
'pullRequests': urls
|
'pullRequests': urls
|
||||||
|
Reference in New Issue
Block a user