This commit is contained in:
2020-02-07 00:35:39 +00:00
parent 0e0e86c4ce
commit 99d37a2d5b
7 changed files with 17 additions and 85 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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",

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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,