From 99d37a2d5bbce944087e86e76ad364d28767cacf Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 7 Feb 2020 00:35:39 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 80 ++++--------------- ayanova/package-lock.json | 5 -- ayanova/package.json | 1 - ayanova/src/api/gzform.js | 2 - .../src/components/custom-fields-control.vue | 2 +- ayanova/src/components/time-control.vue | 8 -- ayanova/src/main.js | 4 - 7 files changed, 17 insertions(+), 85 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 8fc2ef6b..79340b1f 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -50,80 +50,32 @@ SHELL / NAV / MENUS / LAYOUT TODO: LOCALIZATION - TODO ACTIONS - - Move localization methods to the LOCALE object and then call it from the filters - - Browser languages in locale: - - some functions are better called with the full array of browser languages because sometimes it needs to use a fallback - - Only the date picker seems to have an issue with handling the full array of languages, the javascript number and date formatters do not and expect a full range - - Need a manual override setting for locale tag "en-US" etc as some browsers seem to be shitty at it - - - TODO: get time zone from browser with user override option - - use browser default unless overridden - - Intl.DateTimeFormat().resolvedOptions().timeZone - - - How to handle dates and times - - All dates stored in UTC format at server and transmitted that way - - Change to timestamp? - - CLIENT DISPLAY: - - Client uses the built in browser tolocale* methods to display dates to user both in their desired format and desired time zone, i.e. NO HOUR ADJUSTMENTS USED - -- Proper way to definitevely display a date in desired time zone: DATE.toLocaleString('en-GB', { timeZone: 'UTC', dateStyle: "short",timeStyle: "short", hour12: false }) - - - CUSTOM DATE FIELD NOT SETTING TIME NOW?? - - SB able to ditch the dayjs library entirely once done! - - - CURRENCY code, need to be able to set currency as a user option, no way to deduce it except maybe a default through deduction of locale - - AM PM or 24 hour time sb a setting in locale - - - Make functional user settings form so can test shit out - - Need override for locale, currency setting, 12hr clock etc etc + - Decimal OUTPUT for grid not done yet, only currency I think + - Currency / decimal INPUT handle commas test to see if working fully + - needs to parse the currency, maybe I can cobble that together since the number portion stays the same?? (arabic?) + - INPUT currency / decimal can a german user input a currency as 1.234,56 ? (comma is the decimal separator and decimal is the thousands separator) + - vuetify currency field: https://gist.github.com/Christilut/1143d453ea070f7e8fa345f7ada1b999 + - Not vuetify specifically but may have stealable code: https://dm4t2.github.io/vue-currency-input/ + + - Get rid of timezone numeric override and any other deprecated stuff (currency symbol, decimal symbol etc) and associated code at client and server + - Add the new overrides for language and timezone and currency code and 12hour at client and server + - Make functional user settings form with all overrides so can test shit out - Need a browser check on opening the login page that will check to ensure the browser can do the date conversions properly etc and tell user browser is unsuitable if it isn't - - TRY AN ALTERNATE LANGUAGE IN VUETIFY USING THEIR METHOD, SEE WHATS INVOLVED - - Find out how to override the default locale for vuetify to set specific items to our localized text version - - this saves having to use a whole locale for just the calendar etc - - DATE / TIME PICKERS - - Find out what locale keys the date and time pickers are using so they can be replaced / overridden - - Test that date / time picker is using the proper locales - - Currency INPUT / DECIMALS - - Find out how or if the currency input can be set to use alternate decimal and group symbols and accept and display that way - - FILTERS - - cobble together my own currency and decimal display filters - PARSERS - Update / test own parser for currency and decimal for validation purposes - already something in there for currency I think - - PLANNING - - Proper way to definitevely display a date in desired time zone: DATE.toLocaleString('en-GB', { timeZone: 'UTC', dateStyle: "short",timeStyle: "short", hour12: false }) - - NEED to accept and display numbers and dates and times, nothing else really matters - - NUMBER FORMATTING REQUIRED INFO - - USEROPTIONS: Currency symbol - - USEROPTIONS: digit grouping symbol (thousands separator) - - USEROPTIONS: decimal symbol - - DATE TIME FORMATTING REQUIRED INFO - - LOCALETEXT: Month names in full - - Month abbreviations 3 characters maybe can just use first 3 of names above - - LOCALETEXT: Day of week - - First letter of day of week and first three letters of day of week are used in date input - - LOCALETEXT: AM / PM symbols - - USEROPTIONS: Short date template - - USEROPTIONS: Short time template - + - - All major browsers support Intl api now: - - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl - - IDENTIFY: what needs to be localized besides display titles? - - Currency input, display - - decimal number input, display - - Date and times MONTH names in input (and some ancillary text maybe like "year") - - Date and time display + + - - INPUT currency / decimal can a german user input a currency as 1.234,56 ? (comma is the decimal separator and decimal is the thousands separator) - - vuetify currency field: https://gist.github.com/Christilut/1143d453ea070f7e8fa345f7ada1b999 - - Not vuetify specifically but may have stealable code: https://dm4t2.github.io/vue-currency-input/ - - Grid display currency - - INPUT Date Months localized - - Display Date time in localized format? + +TODO: CUSTOMIZE not working on widget edit form +TODO: CUSTOM DATE FIELD NOT SETTING NOW?? TODO: toolbar above grid for filters, refresh etc (make it a standard component?) TODO: main.js filters need to be finished diff --git a/ayanova/package-lock.json b/ayanova/package-lock.json index 5b94fb13..33451985 100644 --- a/ayanova/package-lock.json +++ b/ayanova/package-lock.json @@ -7857,11 +7857,6 @@ "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", "dev": true }, - "dayjs": { - "version": "1.8.18", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.8.18.tgz", - "integrity": "sha512-JBMJZghNK8TtuoPnKNIzW9xavVVigld/zmZNpZSyQbkb2Opp55YIfZUpE4OEqPF/iyUVQTKcn1bC2HtC8B7s3g==" - }, "de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", diff --git a/ayanova/package.json b/ayanova/package.json index 8b1ddf88..e3f42143 100644 --- a/ayanova/package.json +++ b/ayanova/package.json @@ -12,7 +12,6 @@ }, "dependencies": { "core-js": "^3.6.1", - "dayjs": "^1.8.18", "jwt-decode": "^2.2.0", "luxon": "^1.22.0", "nprogress": "^0.2.0", diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index 1e6e0942..9fab20f4 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -244,8 +244,6 @@ export default { return false; } - // valueStart = window.$gz.dayjs(valueStart); - // valueEnd = window.$gz.dayjs(valueEnd); valueStart = window.$gz.DateTime.fromISO(valueStart); valueEnd = window.$gz.DateTime.fromISO(valueEnd); diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index 36fa1a8a..c7400a91 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -224,7 +224,7 @@ export default { case "time": case "datetime": //can it be parsed into a date using the same library as the components use? - if (!window.$gz.dayjs(ret).isValid()) { + if (!window.$gz.DateTime.fromISO(ret).isValid()) { ret = null; } break; diff --git a/ayanova/src/components/time-control.vue b/ayanova/src/components/time-control.vue index 529a1dc1..843db81f 100644 --- a/ayanova/src/components/time-control.vue +++ b/ayanova/src/components/time-control.vue @@ -97,14 +97,6 @@ export default { this.hour12 ); }, - // formatDate() { - // return this.value - // ? window.$gz.dayjs - // .utc(this.value) - // .add(window.$gz.locale.format().timeZoneOffset, "hour") - // .format(window.$gz.locale.format().shortDate) - // : ""; - // }, formatTime() { return window.$gz.locale.utcDateToShortTimeLocalized( this.value, diff --git a/ayanova/src/main.js b/ayanova/src/main.js index 5518051f..2c63ee85 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -10,10 +10,7 @@ import "./registerServiceWorker"; import errorHandler from "./api/errorhandler"; import NProgress from "nprogress"; import "nprogress/nprogress.css"; -import dayjs, { Dayjs } from "dayjs"; import { DateTime } from "luxon"; -import UTC from "dayjs/plugin/utc"; // load on demand -dayjs.extend(UTC); // use plugin import lodash from "./libs/lodash.min.js"; //my libs @@ -57,7 +54,6 @@ window.$gz = { menu: gzmenu, dialog: gzdialog, util: gzutil, - dayjs: dayjs, DateTime: DateTime, _: lodash, api: gzapi,