Skip to content

Commit

Permalink
change(notifications): convert unix timestamp into human readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Jul 20, 2024
1 parent c75cdb4 commit 606deb9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const electronShell = require('electron').shell;
const toasted = require('toasted-notifier');
const process = require('process');
const path = require('path');
const moment = require('moment');
const Store = require('./store.js');

/*
Expand Down Expand Up @@ -693,13 +694,20 @@ function ready() {
continue;
}

/*
convert unix timestamp into human readable
*/

const dateHuman = moment.unix(time).format('YYYY-MM-DD hh:mm a');

/*
@ref : https://github.com/Aetherinox/toasted-notifier
*/

toasted.notify({
title: `Topic: ${topic}`,
title: `${topic} - ${dateHuman}`,
message: `${message}`,
actions: ['Acknowledge'],
persistent: (store.get('bPersistentNoti') === 0 ? false : true),
sticky: (store.get('bPersistentNoti') === 0 ? false : true)
});
Expand Down

0 comments on commit 606deb9

Please sign in to comment.