Skip to content

Commit 2b47fed

Browse files
authored
add communityDateForge function (#31)
1 parent 4c1e9fc commit 2b47fed

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatconference/api",
33
"description": "THAT-API shared library for all microservices",
4-
"version": "1.12.0",
4+
"version": "1.13.0",
55
"main": "index.js",
66
"scripts": {
77
"build": "rimraf __build__ && babel ./src -d ./__build__ --copy-files --ignore ./**/__tests__",

src/utility/firestoreDateForge.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ function partners(partner) {
8181
return partnerOut;
8282
}
8383

84+
function communities(community) {
85+
dlog('communities');
86+
const communityOut = community;
87+
if (community.createdAt)
88+
communityOut.createdAt = dateForge(community.createdAt);
89+
if (community.lastUpdatedAt)
90+
communityOut.lastUpdatedAt = dateForge(community.lastUpdatedAt);
91+
92+
return communityOut;
93+
}
94+
8495
export default {
8596
dateForge,
8697
sessions,
@@ -89,4 +100,5 @@ export default {
89100
votes,
90101
earnedMeritBadges,
91102
partners,
103+
communities,
92104
};

0 commit comments

Comments
 (0)