mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Simple localization support and currency selector.
Summary: - Grist document has a associated "locale" setting that affects how currency is formatted. - Currency selector for number format. Test Plan: not done Reviewers: dsagal Reviewed By: dsagal Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D2977
This commit is contained in:
@@ -19,7 +19,10 @@ function CopySelection(tableData, rowIds, fields, options) {
|
||||
this.colStyle = options.colStyle;
|
||||
this.columns = fields.map((f, i) => {
|
||||
let formatter = ValueFormatter.createFormatter(
|
||||
f.displayColModel().type(), f.widgetOptionsJson());
|
||||
f.displayColModel().type(),
|
||||
f.widgetOptionsJson(),
|
||||
f.documentSettings()
|
||||
);
|
||||
let _fmtGetter = tableData.getRowPropFunc(this.displayColIds[i]);
|
||||
let _rawGetter = tableData.getRowPropFunc(this.colIds[i]);
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ export class GristDoc extends DisposableWithEvents {
|
||||
app.topAppModel.getUntrustedContentOrigin(), this.docComm, app.clientScope);
|
||||
|
||||
// Maintain the MetaRowModel for the global document info, including docId and peers.
|
||||
this.docInfo = this.docModel.docInfo.getRowModel(1);
|
||||
this.docInfo = this.docModel.docInfoRow;
|
||||
|
||||
const defaultViewId = this.docInfo.newDefaultViewId;
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ class Searcher {
|
||||
|
||||
this._fieldStepper.array = section.viewFields().peek();
|
||||
this._fieldFormatters = this._fieldStepper.array.map(
|
||||
f => createFormatter(f.displayColModel().type(), f.widgetOptionsJson()));
|
||||
f => createFormatter(f.displayColModel().type(), f.widgetOptionsJson(), f.documentSettings()));
|
||||
return tableModel;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export function addColTypeSuffix(type: string, column: ColumnRec, docModel: DocM
|
||||
return `${type}:${refTableId}`;
|
||||
}
|
||||
case "DateTime":
|
||||
return 'DateTime:' + docModel.docInfo.getRowModel(1).timezone();
|
||||
return 'DateTime:' + docModel.docInfoRow.timezone();
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user