mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 00:04:48 +02:00
Format dates with moment
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user