dependencies: Replace moment.js with date-fns.

Replaced methods/functions of moment.js with date-fns library.
The motive was to replace it with a smaller frontend timezone library.

Date-fns ~ 11.51 kb
moment.js ~ 217.87 kb

Some of the format strings change because date-fns encodes them
differently from how moment did.

Fixes #16373.
This commit is contained in:
aryanshridhar
2020-09-30 01:50:46 +05:30
committed by Tim Abbott
parent 26a81ab3aa
commit f92f99d92d
19 changed files with 112 additions and 77 deletions

View File

@@ -1,7 +1,6 @@
"use strict";
const moment = require("moment-timezone");
const timezones = require("../generated/timezones.json");
const render_settings_tab = require("../templates/settings_tab.hbs");
const people = require("./people");
@@ -71,7 +70,7 @@ exports.build_page = function () {
page_params.enable_sounds || page_params.enable_stream_audible_notifications,
zuliprc: "zuliprc",
botserverrc: "botserverrc",
timezones: moment.tz.names(),
timezones: timezones.timezones,
can_create_new_bots: settings_bots.can_create_new_bots(),
settings_label: exports.settings_label,
demote_inactive_streams_values: settings_config.demote_inactive_streams_values,