mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 22:32:50 +02:00
Fix
This commit is contained in:
@@ -36,8 +36,9 @@ module.exports = class CalendarCommand extends Command {
|
|||||||
------------------------------------
|
------------------------------------
|
||||||
`;
|
`;
|
||||||
display += '\n';
|
display += '\n';
|
||||||
const startDay = new Date(year, month - 1, 1).getDay();
|
let startDay = new Date(year, month - 1, 1);
|
||||||
if (year > 100) startDay.setFullYear(year);
|
if (year < 100) startDay.setFullYear(year);
|
||||||
|
startDay = startDay.getDay();
|
||||||
for (let i = 0; i < startDay; i++) {
|
for (let i = 0; i < startDay; i++) {
|
||||||
display += ' ';
|
display += ' ';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ module.exports = class DaysSinceCommand extends Command {
|
|||||||
run(msg, { month, day, year }) {
|
run(msg, { month, day, year }) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const past = new Date(year, month - 1, day);
|
const past = new Date(year, month - 1, day);
|
||||||
if (year > 100) past.setFullYear(year);
|
if (year < 100) past.setFullYear(year);
|
||||||
const pastFormat = moment.utc(past).format('dddd, MMMM Do, YYYY');
|
const pastFormat = moment.utc(past).format('dddd, MMMM Do, YYYY');
|
||||||
const time = moment.duration(now - past);
|
const time = moment.duration(now - past);
|
||||||
return msg.say(`There have been ${time.format('Y [years,] M [months and] d [days]')} since ${pastFormat}!`);
|
return msg.say(`There have been ${time.format('Y [years,] M [months and] d [days]')} since ${pastFormat}!`);
|
||||||
|
|||||||
Reference in New Issue
Block a user