Format dates with moment

This commit is contained in:
Daniel Odendahl Jr
2018-09-20 16:38:05 +00:00
parent 553abdb6fa
commit 42bd597db7
26 changed files with 81 additions and 51 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
const Command = require('../../structures/Command');
const moment = require('moment');
const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const { shorten, base64 } = require('../../util/Util');
@@ -46,8 +47,8 @@ module.exports = class GithubCommand extends Command {
.addField(' Forks', body.forks, true)
.addField(' Issues', body.open_issues, true)
.addField(' Language', body.language || '???', true)
.addField(' Creation Date', new Date(body.created_at).toDateString(), true)
.addField(' Modification Date', new Date(body.updated_at).toDateString(), true);
.addField(' Creation Date', moment.utc(body.created_at).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
.addField(' Modification Date', moment.utc(body.updated_at).format('MMM Do, YYYY [at] hh:mm:ss A'), true);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Could not find any results.');