gristlabs_grist-core/app/common
Alex Hall 5b352211c4 (core) Guess date format during type conversion
Summary:
- Adds a dependency moment-guess (https://github.com/apoorv-mishra/moment-guess) to guess date formats from strings. However the npm package is missing source maps which leads to an ugly warning, so currently using a fork until https://github.com/apoorv-mishra/moment-guess/pull/22 is resolved.
- Adds guessDateFormat using moment-guess to determine the best candidate date format. The logic may be refined for e.g. lossless imports where the stakes are higher, but for now we're just trying to make type conversions smoother.
- Uses guessDateFormat to guess widget options when changing column type to date or datetime.
- Uses the date format of the original column when possible instead of guessing.
- Fixes a bug where choices were guessed based on the display column instead of the visible column, which made the guessed choices influenced by which values were referenced as well as completely broken when converting from reflist.
- @dsagal @georgegevoian This builds on https://phab.getgrist.com/D3265, currently unmerged. That diff was created first to alert to the change. Without it there would still be similar test failures/changes here as the date format would often be concretely guessed and saved as YYYY-MM-DD instead of being left as the default `undefined` which is shows as YYYY-MM-DD in the dropdown.

Test Plan: Added a unit test to `parseDate.ts`. Updated several browser tests which show the guessing in action during type conversion quite nicely.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: dsagal, georgegevoian

Differential Revision: https://phab.getgrist.com/D3264
2022-02-21 22:39:47 +02:00
..
ACLPermissions.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
ACLRuleCollection.ts (core) Use MetaTableData more 2021-12-07 17:09:58 +02:00
ActionBundle.ts (core) discount indirect changes for access control purposes 2021-05-12 11:26:21 -04:00
ActionDispatcher.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
ActionGroup.ts (core) do not look at content of recent actions when loading documents 2021-09-29 11:27:02 -04:00
ActionRouter.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
ActionSummary.ts Correct spelling mistakes 2022-02-19 09:46:49 +00:00
ActiveDocAPI.ts Correct spelling mistakes 2022-02-19 09:46:49 +00:00
ApiError.ts (core) give more detailed reasons for access denied when memos are present 2021-02-15 17:02:24 -05:00
arrayToString.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
AsyncCreate.ts (core) add a python3 button 2021-09-16 10:06:04 -04:00
AsyncFlow.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
BaseAPI.ts (core) give more detailed reasons for access denied when memos are present 2021-02-15 17:02:24 -05:00
BasketClientAPI.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
BigInt.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
BillingAPI.ts (core) Add some polish to the billing page, particularly for sign-up. 2021-11-04 14:23:53 -04:00
BinaryIndexedTree.js Correct spelling mistakes 2022-02-19 09:46:49 +00:00
BrowserSettings.ts (core) Simple localization support and currency selector. 2021-08-26 13:36:49 -07:00
ColumnFilterFunc.ts (core) Polish and enable Reference List widget 2021-08-12 11:51:21 -07:00
ColumnGetters.ts (core) Adding sort options for columns. 2021-11-03 15:31:39 +01:00
csvFormat.ts (core) Add our very own implementation of tokenfield (aka pillbox, tag list) 2021-05-03 17:16:24 -04:00
CustomWidget.ts (core) Widget options api 2022-01-13 11:10:17 +01:00
declarations.d.ts (core) Guess date format during type conversion 2022-02-21 22:39:47 +02:00
delay.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
DisposableWithEvents.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
DocActions.ts (core) Duplicate page should copy filters. 2022-01-04 14:49:33 +01:00
DocData.ts (core) Initial webhooks implementation 2021-09-23 14:35:39 +02:00
DocListAPI.ts (core) do not look at content of recent actions when loading documents 2021-09-29 11:27:02 -04:00
DocSnapshot.ts (core) revamp snapshot inventory 2020-10-30 13:52:46 -04:00
DocumentSettings.ts (core) add a python3 button 2021-09-16 10:06:04 -04:00
emails.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
EncActionBundle.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
ErrorWithCode.ts (core) give more detailed reasons for access denied when memos are present 2021-02-15 17:02:24 -05:00
Features.ts (core) add free team site product 2022-02-04 09:00:51 -05:00
FilterState.ts (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
Formula.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
GranularAccessClause.ts (core) Use MetaTableData more 2021-12-07 17:09:58 +02:00
GristServerAPI.ts (core) Remove a bunch of dead code 2021-07-01 18:38:21 +02:00
gristTypes.ts (core) Custom Widget column mapping feature. 2022-02-08 17:41:04 +01:00
gristUrls.ts (core) Add new Grist sign-up page 2022-02-14 10:32:47 -08:00
gutil.ts (core) Guess date format during type conversion 2022-02-21 22:39:47 +02:00
InactivityTimer.ts Correct spelling mistakes 2022-02-19 09:46:49 +00:00
isHiddenTable.ts (core) New type conversion in the backend 2022-02-04 20:28:13 +02:00
KeyedMutex.ts (core) fix sync to s3 when doc is marked as dirty but proves to be clean 2020-11-10 08:12:31 -05:00
KeyedOps.ts (core) start reconciling forking with granular access 2021-01-12 14:08:49 -05:00
LocaleCodes.ts (core) Extending default locale list 2021-09-24 15:10:13 +02:00
Locales.ts (core) Extending default locale list 2021-09-24 15:10:13 +02:00
LoginSessionAPI.ts (core) Add account page option to allow Google login 2022-02-14 16:56:23 -08:00
LoginState.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
marshal.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
MemBuffer.js (core) move home server into core 2020-07-21 20:39:10 -04:00
NumberFormat.ts (core) Adding fallback for currency symbol 2021-11-04 22:39:34 +01:00
NumberParse.ts (core) Generic number parsing functionality. 2021-10-19 23:19:13 +02:00
orgNameUtils.ts (core) Subdomain can start from a number 2021-09-01 18:16:57 +02:00
parseDate.ts (core) Guess date format during type conversion 2022-02-21 22:39:47 +02:00
plugin.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
PluginInstance.ts Correct spelling mistakes 2022-02-19 09:46:49 +00:00
Prefs.ts (core) Replace questionnaire for new users with a popup asking for just their primary use-case. 2022-01-14 10:16:11 -05:00
RefCountMap.ts (core) Fix an insidious bug in RefCountMap, manifesting as JS errors some time after import. 2020-11-06 09:24:56 -05:00
resetOrg.ts (core) move more tests to grist-core 2021-12-10 18:33:07 -05:00
roles.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
RowFilterFunc.ts (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
schema.ts (core) Create an extra raw data widget when creating a table 2022-02-01 21:19:30 +02:00
ShareAnnotator.ts (core) annotate guests of other docs correctly in UserManager dialog 2021-12-09 12:57:52 -05:00
sharing.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
SortFunc.ts Correct spelling mistakes 2022-02-19 09:46:49 +00:00
SortSpec.ts (core) Adding sort options for columns. 2021-11-03 15:31:39 +01:00
StringUnion.ts (core) Implement updated DocMenu UI: list/card mode and sort mode. 2020-08-19 11:31:42 -04:00
TableData.ts (core) Guess date format during type conversion 2022-02-21 22:39:47 +02:00
TabularDiff.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
tbind.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
TestState.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
timeFormat.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
tpromisified.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
tsconfig.json (core) more grist-core cleanup 2020-07-23 16:21:08 -04:00
tsvFormat.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
UIRowId.ts (core) Support 'new' row in anchor links. 2021-09-24 09:01:10 -04:00
uploads.ts (core) Extending Google Drive integration scope 2021-10-01 10:47:12 +02:00
urlUtils.ts (core) remove metrics 2020-09-29 18:57:56 -04:00
UserAPI.ts (core) Add account page option to allow Google login 2022-02-14 16:56:23 -08:00
UserConfig.ts (core) Remove REPL code 2021-07-20 15:17:03 +02:00
ValueConverter.ts (core) Use visible column formatting when converting RefList to Text 2022-02-12 09:45:57 +02:00
ValueFormatter.ts Correct spelling mistakes 2022-02-19 09:46:49 +00:00
ValueParser.ts (core) Add PUT /records DocApi endpoint to AddOrUpdate records 2022-02-12 09:44:34 +02:00