@plusscommunities/pluss-core-aws 2.0.17-beta.0 → 2.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ const moment = require("moment-timezone");
2
+
3
+ module.exports = (dateString, timeOfDay, timezone, resultFormat = "value") => {
4
+ // Parse the date string into a moment object in the given timezone
5
+ const dateMoment = moment.tz(dateString, "DD-MM-YYYY", timezone);
6
+
7
+ // Calculate the hours and minutes from the timeOfDay in minutes
8
+ const hours = Math.floor(timeOfDay / 60);
9
+ const minutes = timeOfDay % 60;
10
+
11
+ // Set the hours and minutes to the dateMoment
12
+ dateMoment.hours(hours).minutes(minutes).seconds(0).milliseconds(0);
13
+
14
+ switch (resultFormat) {
15
+ case "string":
16
+ // return the timestamp in string format
17
+ return dateMoment.format();
18
+ case "value":
19
+ // Return the timestamp in milliseconds
20
+ return dateMoment.valueOf();
21
+ default:
22
+ // return the timestamp in a formatted string
23
+ return dateMoment.format(resultFormat);
24
+ }
25
+ };
@@ -0,0 +1,17 @@
1
+ const _ = require("lodash");
2
+ const { getRowId } = require("../");
3
+ const getRef = require("../../db/common/getRef");
4
+
5
+ module.exports = async (site) => {
6
+ if (site) {
7
+ const timezone = await getRef(
8
+ "strings",
9
+ "RowId",
10
+ getRowId(site, "timezone")
11
+ );
12
+ if (timezone && !_.isEmpty(timezone.Value)) {
13
+ return timezone.Value;
14
+ }
15
+ }
16
+ return "Australia/Brisbane";
17
+ };
@@ -120,9 +120,12 @@ module.exports = (noti) => {
120
120
  thisNoti.Text = noti.Data.message;
121
121
  thisNoti.Icon = "bell-o";
122
122
  } else if (type.startsWith("FeedPostApproved")) {
123
- thisNoti.Text = `You have a new post`;
123
+ thisNoti.Text = `You have a new post for ${noti.Data.user.displayName}`;
124
124
  thisNoti.Subtext = noti.Data.title;
125
- thisNoti.Icon = "commenting";
125
+ thisNoti.Icon = "bars";
126
+ } else if (type.startsWith("FeedPostToday")) {
127
+ thisNoti.Text = `Review today's posts for ${noti.Data.displayName}`;
128
+ thisNoti.Icon = "bars";
126
129
  } else {
127
130
  thisNoti.Text = "You have received a notification";
128
131
  thisNoti.Icon = "bell-o";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-aws",
3
- "version": "2.0.17-beta.0",
3
+ "version": "2.0.17",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "scripts": {
6
6
  "betapatch": "npm version prepatch --preid=beta",
@@ -22,6 +22,7 @@
22
22
  "https": "^1.0.0",
23
23
  "lodash": "^4.17.10",
24
24
  "moment": "^2.30.1",
25
+ "moment-timezone": "^0.5.41",
25
26
  "node-fetch": "^2.2.0",
26
27
  "node-jose": "^1.0.0",
27
28
  "nodemailer": "^6.9.12",