Moment (#5808)
- Add npm packages - Add moment builds in frappe-web - Remove import statements to avoid duplicate loading of moment
This commit is contained in:
parent
f8dc45c3c1
commit
0b44529dc9
12 changed files with 25 additions and 25 deletions
|
|
@ -18,6 +18,8 @@
|
|||
"public/js/frappe/polyfill.js",
|
||||
"public/js/lib/md5.min.js",
|
||||
"public/js/frappe/provide.js",
|
||||
"node_modules/moment/min/moment-with-locales.js",
|
||||
"node_modules/moment-timezone/builds/moment-timezone-with-data.js",
|
||||
"public/js/frappe/format.js",
|
||||
"public/js/frappe/misc/number_format.js",
|
||||
"public/js/frappe/misc/utils.js",
|
||||
|
|
@ -121,8 +123,8 @@
|
|||
"public/js/lib/jquery/jquery.hotkeys.js",
|
||||
"public/js/lib/summernote/summernote.js",
|
||||
"public/js/lib/bootstrap.min.js",
|
||||
"public/js/lib/moment/moment-with-locales.min.js",
|
||||
"public/js/lib/moment/moment-timezone-with-data.min.js",
|
||||
"node_modules/moment/min/moment-with-locales.min.js",
|
||||
"node_modules/moment-timezone/builds/moment-timezone-with-data.min.js",
|
||||
"public/js/lib/socket.io.min.js",
|
||||
"public/js/lib/jSignature.min.js",
|
||||
"public/js/frappe/translate.js",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Author - Achilles Rasquinha <achilles@frappe.io>
|
||||
|
||||
import Fuse from 'fuse.js'
|
||||
import moment from 'moment'
|
||||
import hyper from '../lib/hyper.min'
|
||||
|
||||
import './socketio_client'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import moment from 'moment';
|
||||
|
||||
|
||||
frappe.ui.form.ControlDate = frappe.ui.form.ControlData.extend({
|
||||
make_input: function() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import moment from 'moment';
|
||||
|
||||
frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
|
||||
make_input: function() {
|
||||
this.has_input = true;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// MIT License. See license.txt
|
||||
|
||||
frappe.provide('frappe.datetime');
|
||||
import moment from 'moment';
|
||||
|
||||
frappe.defaultDateFormat = "YYYY-MM-DD";
|
||||
frappe.defaultTimeFormat = "HH:mm:ss";
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
frappe/public/js/lib/moment/moment.min.js
vendored
2
frappe/public/js/lib/moment/moment.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,3 @@
|
|||
import moment from 'moment';
|
||||
import WebForm from './webform';
|
||||
|
||||
frappe.ready(function() {
|
||||
|
|
|
|||
|
|
@ -19,12 +19,13 @@
|
|||
"awesomplete": "^1.1.2",
|
||||
"cookie": "^0.3.1",
|
||||
"express": "^4.16.2",
|
||||
"frappe-datatable": "^0.0.6",
|
||||
"frappe-datatable": "^1.1.2",
|
||||
"frappe-gantt": "^0.1.0",
|
||||
"fuse.js": "^3.2.0",
|
||||
"highlight.js": "^9.12.0",
|
||||
"jsbarcode": "^3.9.0",
|
||||
"moment": "^2.20.1",
|
||||
"moment-timezone": "^0.5.21",
|
||||
"redis": "^2.8.0",
|
||||
"showdown": "^1.8.6",
|
||||
"socket.io": "^2.0.4",
|
||||
|
|
|
|||
|
|
@ -73,7 +73,11 @@ function build_libs() {
|
|||
const input_files = get_build_json('frappe')[libs_path];
|
||||
|
||||
const libs_content = input_files.map(file_name => {
|
||||
const full_path = path.resolve(get_app_path('frappe'), file_name);
|
||||
let prefix = get_app_path('frappe');
|
||||
if (file_name.startsWith('node_modules/')) {
|
||||
prefix = path.resolve(get_app_path('frappe'), '..');
|
||||
}
|
||||
const full_path = path.resolve(prefix, file_name);
|
||||
return `/* ${file_name} */\n` + fs.readFileSync(full_path);
|
||||
}).join('\n\n');
|
||||
|
||||
|
|
|
|||
16
yarn.lock
16
yarn.lock
|
|
@ -954,9 +954,9 @@ forwarded@~0.1.2:
|
|||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
|
||||
|
||||
frappe-datatable@^0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-0.0.6.tgz#4fc7ad619bd59b8120e97987f81c069c37e63a87"
|
||||
frappe-datatable@^1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.1.2.tgz#d28841fa9161ef2329032376fb48758456dbc9cb"
|
||||
dependencies:
|
||||
clusterize.js "^0.18.0"
|
||||
lodash "^4.17.5"
|
||||
|
|
@ -1764,6 +1764,16 @@ minimist@^1.1.3, minimist@^1.2.0:
|
|||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
moment-timezone@^0.5.21:
|
||||
version "0.5.21"
|
||||
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.21.tgz#3cba247d84492174dbf71de2a9848fa13207b845"
|
||||
dependencies:
|
||||
moment ">= 2.9.0"
|
||||
|
||||
"moment@>= 2.9.0":
|
||||
version "2.22.2"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"
|
||||
|
||||
moment@^2.20.1:
|
||||
version "2.20.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue