News in versions: FastGrid 1.0, TreeGrid 17.0
FastGrid FastSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Development
services
References References Contacts
TreeGrid Gantt chart SpreadSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Contacts
FastGrid documentation
Search in documentation
FastGrid versions compatibility

Changes log (txt file) Compare FastGrid 1.0 & TreeGrid 17.1

Using in JavaScript frameworks

Angular Ember Express React Svelte Vue Other frameworks NodeJS server SalesForce LWC

Data and creating FastGrid

Simple examples of creating FastGrid Create FastGrid Display grid Access grid by API Sheets, more grids switched in one place Layout and configuration Data rows, columns, toolbars, images Changes in data rows, columns, toolbars Saving changes to server Mark changes Loading children on expand parent Short format

Layout - grid parts

Parts - ColParts and RowParts Part size Part scroll position Sets Column sets Row sets

Toolbars

Toolbar Cells Icon Height Width Toolbar position Dragging and manipulating cells Special toolbars

Rows and columns
Default rows, columns, cells, toolbars
Row and column identity

Row / column id Row / column index Row / column name

Row and column manipulation

API to get grid objects Auto added columns & rows on scroll Blocks of rows / columns Adding / copying / moving Deleting Showing and hiding Layout menu Selecting rows and columns Fill cell values by dragging Locking grid against changes Undo & redo

Row and column tree

Row and column tree Row tree Column tree Expand & collapse

Cells
Cell values and attributes

Read and write any values by API Cell value Cell attributes Cell value & attributes in UTF8 Store

Editing cells

Editing During editing Validation and errors

Cell images

Row cell side icons Icons definition Mark icons and charts Mark icons list Row cell floating images

Cell size

Row height Column width Resizing rows and columns Padding Margin Cell span

Cell style

Grid style and look Cell style permissions Cell style Cell outer border Cell inner border Alternate row & column background

Other cell features

Cell hyperlink Cell tooltip Static cells Other cell attributes Row & column attributes to speed up

Cell types and formats
Cell type and format Range - more values / ranges in cell String type Html type Auto type
Bool type

Bool type Check side icon Bool type & Check side icon

Number type

Format Localization

Date type

Format Localization Calendar

Calculations - formulas
JavaScript formulas

JavaScript formulas Aggregate functions String aggregate functions Other functions

Editable formulas

Formula rules Formula attributes Defined names for editable formulas Conditional functions Lookup functions Cell reference functions Logical functions Informational functions Mathematical functions Trigonometry functions Rounding numbers Number conversions String functions Date functions Summary functions

Dialogs and menus

Dialog Dialog Place Dialog API Menu definition in Script Cell menu List Suggest

Features
Sorting rows / columns

Sorting Sorting settings Comparing strings

Grouping rows / columns

Grouping Grouping settings Comparing strings Pivot grid

Filtering rows and columns

Filtering Filter settings Comparing strings

Search in cells Import files to grid
Export files

Export files Export and copy to clipboard CSV data

Copy & paste via system clipboard

Copy & paste Copy to clipboard Paste from clipboard

Printing

Print Print to PDF

Global grid settings
Grid size & scroll

Grid size Grid scrollbars Paging and view Media rules - responsive design

Saving settings in storage or cookies
Focus and hover cells

Focus cell and cell ranges Mouse hover cells Highlight cells, rows and columns

Events

Mouse events Key events API events

Language

Translation Languages

Messages

Message Message style

Other API

API for iterating rows and columns Paint and repaint Various API methods

Debug & files

Debugging FastGrid files

UTF8 Store - fast & short data
Introduction - License & download

Basic description Main advantages Basic usage License Download Documentation

Script language implementations

JavaScript C# JAVA PHP

Suggested ucodes

Bits - small integers or enums Integers or enums with strings Date and time Floating point numbers Special strings

Basic ucodes

Integer 1 char String 1 char Date 1 char Bits 1 char Integer 2 chars String 2 chars Date 2 chars Float 2 chars Integer 3 chars String 3 chars Date 3 chars Integer and double float 5 chars String 5 chars Date 5 chars Fixed length string Separated strings Adjacent strings Prefix for escaping string Fixed length data Unused custom codes Prefix for stored separator or length Prefix for stored base number Unused basic ucodes

Complex ucodes

chars signed decimals multiple limits varstrings escape base chars2 signed2 decimals2 multiple2 limits2

Internal coding Profiling times for ucode options Function reference

Date and time - Date type

FastGrid documentation

Date type shows date and / or time in selected format.
It supports direct editing or selecting the date(s) from popup calendar.

Format

Cell, Tool string

Type

["Auto"] Type = "Date" GetAttr SetAttr
Date type can be explicitly set by Type = "Date" or it can be automatically chosen according to Format by default Type = "Auto"
Cell, Tool any

V / Value

GetValue / GetAttr SetAttr
The date values in input JSON and by API GetValue / SetValue can be set as number or as string.

The date values as number are the fastest to parse and can be:
ExcelDates=0: integer number of milliseconds since 1/1/1970 00:00:00. Time only is between 0 - 86,400,000
ExcelDates=1: floating point number of days since 12/31/1899 (and includes not existing day 2/29/1900), the same as MS Excel. Time only is between 0.0 - 1.0.
Setting dates as numbers is strongly recommended for large grids. Reading 1M cells takes 50 ~ 200ms.

The fast recommended date string formats are: "M/d/yyyy" and "yyyy/M/d".
The fast recommended time string format are: "H:m", "H:m:s", "h:m am/pm", "h:m:s am/pm".
The date string can contain only date, only time or data + time separated by one space. No other spaces should be used.
For example: "12/31/2021", "12:34:56", "1/9/2021 4:2:6", "01/09/2021 04:02:06 am".
Reading 1M cells in the fast date strings takes 500 ~ 1500ms.

Other acceptable string formats with slower parsing are:
date: "yyyy-M-d", "M-d", "M/d/yyyy", "M/d", "d.M.yyyy" (d.M is not permitted)
time: "H:m", "H:m:s", "H.m", "H.m.s", "h:m", "h.m.s", "h.m", "h.m.s" with am / pm, AM / PM, a.m. / p.m., A.M. / P.M. (with or without space after time)
If set only time, it cannot be separated by dot.
Reading 1M cells in the slow date strings takes 1000 ~ 2000ms.

The date format in data can be more specified by DateFormatIn.
The edited date values and set by SetString are saved according to DateFormatOut.
The date values are uploaded to server as they are set.
Cfg string

DateFormatIn

GetCfgAttr SetCfgAttr
Date format string to be used to parse the date values in input JSON and by API GetValue / SetValue.
It can be set also to 1 to use always the slower date strings (see in the V / Value) to avoid browser dependent date parsing.
Cfg int / string

DateFormatOut

[0] GetCfgAttr SetCfgAttr
Specifies how dates are saved after editing or setting by API SetString.
0 - as number according to ExcelDates.
1 - as date string according to DateSeparator:
'/' - M/d/yyyy HH:mm:ss or M/d/yyyy HH:mm or M/d/yyyy or HH:mm:ss or HH:mm
'.' - d.M.yyyy HH:mm:ss or d.M.yyyy HH:mm or d.M.yyyy or HH:mm:ss or HH:mm
'-' - yyyy-M-d HH:mm:ss or yyyy-M-d HH:mm or yyyy-M-d or HH:mm:ss or HH:mm
2 - as date string according to DateSeparator:
'/' - MM/dd/yyyy HH:mm:ss or MM/dd/yyyy HH:mm or MM/dd/yyyy or HH:mm:ss or HH:mm
'.' - dd.MM.yyyy HH:mm:ss or dd.MM.yyyy HH:mm or dd.MM.yyyy or HH:mm:ss or HH:mm
'-' - yyyy-MM-dd HH:mm:ss or yyyy-MM-dd HH:mm or yyyy-MM-dd or HH:mm:ss or HH:mm
Or it can be set to exact date format string to not omit the not set date parts like time, the supported formats are only the formats listed in points 1 and 2.
Cfg bool

ExcelDates

[0] / [1] GetCfgAttr
0 - all dates in grid are integer numbers as count of milliseconds since 1/1/1970.
1 - all dates in grid are floating point numbers as count of days since 1/1/1900.
It affects everything, input data and output data if dates are numbers and all dates for API.
Setting to 1 is useful especially if importing xlsx file with dates.
Cfg bool

ErrorDates

[0] GetCfgAttr SetCfgAttr
If set and the Date Type or Auto Type with date cannot be displayed whole, it is shown as "###" error.
!! Cfg bool

HtmlFormat

[0] GetCfgAttr SetCfgAttr
If set, the Format can contain HTML code. Remember, the code must be in '' or "" and must contain only inline tags, like Html type.
Using many cells with HTML code remarkably slows down paint!
Cfg, Cell, Tool any

DefaultDate

GetCfgAttr / GetAttr SetCfgAttr / SetAttr
Default date (and time) shown in calendar for empty dates. Can be set as number or date string like the V / Value
Used also when editing date / time in cell, the missing parts in the input are got from the DefaultDate.
For example input: "12/12" and DefaultDate: "1/1/2000 21:30" will return "12/12/2000 21:30"
Cell, Tool string

Format

GetAttr SetAttr
Specifies date and / or time string format - how the date and / or time will be displayed.
This format string uses almost the same formatting as Microsoft .NET System.DateTime.ToString (string format) function.
Empty format
If the Format is not set or is empty (default), it is used default format according to DateSeparator:
'/' - M/d/yyyy HH:mm:ss or M/d/yyyy HH:mm or M/d/yyyy or HH:mm:ss or HH:mm
'.' - d.M.yyyy HH:mm:ss or d.M.yyyy HH:mm or d.M.yyyy or HH:mm:ss or HH:mm
'-' - yyyy-M-d HH:mm:ss or yyyy-M-d HH:mm or yyyy-M-d or HH:mm:ss or HH:mm
If some part of the date is 0, it is omitted, some examples: "5/9/2000 12:43:56", "12:00", "6/5/2000".
Auto format (two letters)
This format uses different date format according to the date value, to hide the empty parts from the date, e.g. zero time or current year. It is designed to use also in AutoDateFormat.
a1 or A1date+time, date, time, with or without seconds"M/d/yyyy", "M/d/yyyy HH:mm", "M/d/yyyy HH:mm:ss", "HH:mm", "HH:mm:ss"
a2 or A2a1 + date without current yeara1 + "M/d", "M/d HH:mm", "M/d HH:mm:ss"
a3 or A3a2 + day without current month"d", "d HH:mm", "d HH:mm:ss", "'today'", "'yesterday'", "'tomorrow'"
a4 or A4a3 + hours without minutes"M/d/yyyy HH", "M/d HH", "d HH", "HH"
The lowercase 'ax' use localized Standard format parts, the uppercase 'Ax' uses Standard full format.
Standard format parts (two or three letters)
Localized in all languages. Separated date and time, to use date with time use Assembled format like "*sd* *tm*".
This format loads user format from file Texts.js in JSON object Format.
It should not start by 'n' to not collide with number formats.
sdShort partial dateUS:"M/d", GB: "d/M", DE:"d.M"
syShort full dateUS:"M/d/yyyy", GB:"d/M/yyyy", DE:"d.M.yyyy"
swShort full date with week dayUS:"ddd M/d/yyyy", GB:"ddd d/M/yyyy", DE:"ddd d.M.yyyy"
smShort month and yearUS:"M/yyyy", GB:"M/yyyy", DE:"M/yyyy"
snShort week numberUS:"\wddddddd", GB:"\wddddddd", DE:"\Wddddddd"
ldLong partial dateUS:"MMMM d", GB:"dddddd MMMM", DE:"dddddd MMMM"
lyLong full dateUS:"MMMM d, yyyy", GB:"dddddd MMMM yyyy", DE:"dddddd MMMM yyyy"
lwLong full date with week dayUS:"dddd, MMMM d, yyyy", GB:"dddd, dddddd MMMM yyyy", DE:"dddd dddddd MMMM yyyy"
lwaLong full date with abbreviated week dayUS:"ddd, MMMM d, yyyy", GB:"ddd, dddddd MMMM yyyy", DE:"ddd dddddd MMMM yyyy"
lmLong month and yearUS:"MMMMMMM yyyy", GB:"MMMMMMM yyyy", DE:"MMMMMMM yyyy"
lnLong week numberUS:"'week' ddddddd", GB:"'week' ddddddd", DE:"'Woche' ddddddd"
adAbbreviated partial dateUS:"MMM d", GB:"dddddd MMM", DE:"dddddd MMM"
ayAbbreviated full dateUS:"MMM d, yyyy", GB:"dddddd MMM yyyy", DE:"dddddd MMM yyyy"
awAbbreviated full date with week dayUS:"ddd, MMM d, yyyy", GB:"ddd, dddddd MMM yyyy", DE:"ddd dddddd MMM yyyy"
awlAbbreviated full date with long week dayUS:"dddd, MMM d, yyyy", GB:"dddd, dddddd MMM yyyy", DE:"dddd dddddd MMM yyyy"
amAbbreviated month and yearUS:"MMMMMMM yyyy", GB:"MMMMMMM yyyy", DE:"MMMMMMM yyyy"
anAbbreviated week numberUS:"'week' ddddddd", GB:"'week' ddddddd", DE:"'Woche' ddddddd"
thStandalone time, hours onlyUS:"h tt", GB:"HH", DE:"HH"
tmStandalone time, hours and minutesUS:"h:mm tt", GB:"HH:mm", DE:"HH:mm"
tsStandalone time, hours, minutes and secondsUS:"h:mm:ss tt", GB:"HH:mm:ss", DE:"HH:mm:ss"
tfStandalone time, hours, minutes, seconds and msUS:"HH:mm:ss.fff", GB:"HH:mm:ss.fff", DE:"HH:mm:ss.fff"
sthTime for short date, hours onlyUS:" h tt", GB:" HH", DE:" HH"
stmTime for short date, hours and minutesUS:" h:mm tt", GB:" HH:mm", DE:" HH:mm"
stsTime for short date, hours, minutes and secondsUS:" h:mm:ss tt", GB:" HH:mm:ss", DE:" HH:mm:ss"
stfTime for short date, hours, minutes, seconds and msUS:" HH:mm:ss.fff", GB:" HH:mm:ss.fff", DE:" HH:mm:ss.fff"
lthTime for long date, hours onlyUS:", h tt", GB:", HH", DE:", HH"
ltmTime for long date, hours and minutesUS:", h:mm tt", GB:", HH:mm", DE:", HH:mm"
ltsTime for long date, hours, minutes and secondsUS:", h:mm:ss tt", GB:", HH:mm:ss", DE:", HH:mm:ss"
ltfTime for long date, hours, minutes, seconds and msUS:", HH:mm:ss.fff", GB:", HH:mm:ss.fff", DE:", HH:mm:ss.fff"
yqYear and quarterUS:"MMMMM yyyy", GB:"MMMMM yyyy", DE:"MMMMM yyyy"
yqYear and halfUS:"MMMMMM yyyy", GB:"MMMMMM yyyy", DE:"MMMMMM yyyy"
Standard full format (one letter)
Auto format is one letter format. This format loads user format from file Texts.js, JSON object Format.
dShort date("M/d/yyyy")
hShort date + short time("M/d/yyyy H:mm")
HShort date + long time("M/d/yyyy H:mm:ss")
jShort date + short time with am/pm("M/d/yyyy h:mm tt")
JShort date + long time with am/pm("M/d/yyyy h:mm:ss tt")
mDay and short month("M/d")
yShort month and year("M/yyyy")
tShort time("H:mm")
TLong time("H:mm:ss")
iShort time with am/pm("h:mm tt")
ILong time with am/pm("h:mm:ss tt")
DLong date("d. MMMM yyyy")
lLong date + short time("d. MMMM yyyy H:mm")
LLong date + long time("d. MMMM yyyy H:mm:ss")
kLong date + short time with am/pm("d. MMMM yyyy h:mm tt")
KLong date + long time with am/pm("d. MMMM yyyy h:mm:ss tt")
MDay and long month("d. MMMM")
YLong month and year("MMMMMMM yyyy"). For month name uses the attribute LongMonthNames2 (from file Texts.js, object Format). LongMonthNames2 could contain noun's first case if the language supports it.
uUniversal sortable date time("yyyy-MM-dd HH:mm:ssZ")
UUniversal date timefor example: 13. January 2004 17:12:34.
RRFC1123("ddd MMM d HH:mm:ss UTCzzzzz yyyy"), for example: Tue, 13 Jan 2004 18:12:34 GMT
aLong date with week("dddd, dddddd MMMM yyyy")
Assembled format
If the format string contains asterisk (*), it loads the user defined formats from the Format object.
For example: Format: { d1:'d/M/yy' d2:'d/M' d3:'yyyy' t1=' HH:mm' },
Format: "*d1" is converted to "d.M.yy", Format: "d1*t1" is converted to "d.M.yy HH:mm", Format: "d2*/*d3*+++*t1" is converted to "d/M/yyyy+++ HH:mm".
The assembled format can refer Standard predefined formats (Parts or Full) and any predefined user format.
The assembled format can refer another assembled format, these references should contain asterisk on both sides.
User format
User format can contain any characters but only few have special meaning and other are written into output without any change.
It is recommended to escape all the not white characters without format meaning by "\" or in "" or ''. For example "'day' d 'in month' M"
Especially number format characters '0', '#', '?', '8' should be escaped.
:Place for time separator, defined in file Texts.js in object Format, attribute TimeSeparator. (colon by default).
/Place for time separator, defined in file Texts.js, object Format, attribute DateSeparator. (slash by default).
dMonth days 1 - 31
ddMonth days 01 - 31
dddWeekdays Sun - Sat
ddddWeekdays Sunday - Saturday
dddddWeekdays S - S
ddddddMonth days 1st - 31st
dddddddYear weeks 1 - 52
ddddddddYear weeks 01 - 52
Dnot used
DDThe rest of days in week, in count of weeks from 1/1/1970 (it is not weekday!)
DDDYear day 0 - 365
DDDDCount of days from 1/1/1970, for duration in days. It is accepted also as [d]
DDDDDCount of weeks from 1/1/1970, for duration in weeks, see DD
DDDDDDTenths of month days: empty,1,2,3
DDDDDDDMonth days: 1-9,0-9,0-9,0-1
MMonth 1 - 12
MMMonth 01 - 12
MMMMonth Jan - Dec
MMMMJanuary - December
MMMMMYear quarters, I, II, III, IV
MMMMMMYear halves, I, II
MMMMMMMJanuary - December, used LongMonthNames2 for languages with inflection
yYear 0 - 99
yyYear 00 - 99
yyyCount of years from 1/1/1970, for duration in years. It is accepted also as [y]
yyyyYear 0000 - 9999
yyyyyYear of week 0000 - 9999, use with week numbers (ddddddd). It differs from yyyy only in few last days in December.
hHours 1 - 12
hhHours 01 - 12
hhhCount of hours from 1/1/1970 00:00:00, for duration in hours. It is accepted also as [h]
hhhhTenths of hours empty or 1
hhhhhHours 1-9, 0-2
HHours 0 - 23
HHHours 00 - 23
HHHnot used
HHHHTenths of hours empty or 1
HHHHHHours 0-9, 0-9, 0-3
mMinutes 0 - 59
mmMinutes 00 - 59
mmmCount of minutes from 1/1/1970 00:00:00, for duration in minutes. It is accepted also as [m]
mmmmTenths of minutes 0 - 5
mmmmmMinutes 0 - 9
sSeconds 0 - 59
ssSeconds 00 - 59
sssCount of seconds from 1/1/1970 00:00:00, for duration in seconds. It is accepted also as [s]
ssssTenths of seconds 0 - 5
sssssSeconds 0 - 9
fHundreds of milliseconds, 0 - 9
ffTenths of milliseconds 00 - 99
fffMilliseconds - 000 - 999
ffffTenths of milliseconds 0 - 9
fffffMilliseconds - 0 - 9
tFirst letter of AM/PM designator, by default A or P as the first character of AMDesignator / PMDesignator. It can be set also by "a/p" or "A/P".
ttAM/PM designator, by default AM or PM. It can be set also by "am/pm" or "AM/PM".
The designator is defined in file Texts.js, object Format, attributes AMDesignator and PMDesignator.
zTimezone hours -12, +0, +13
zzTimezone hours -12, +00, +13
zzzTimezone hours and minutes, -12:00, +0:00, +13:00
\Escape character, the next character is placed to output without any changes. Use to place format characters as d,M,y,...
In JSON all the characters '\' must be doubled. To place the '\' itself, doubled it '\\' (in JSON as '\\\\').
'xxx' or "xxx"Characters in quotes or double quotes are placed to output without any changes. Use to place format characters as d,M,y,...
%Place before format when use one character user format like 'd' (=> '%d') to not be taken as standard format.
;Separates the format for text as prefix@suffix where @ displays the text or if @ is missing, it displays only the text after the ";".
It separates the formats with conditions.
[color]Colors the whole text in given CSS color.
[condition] Uses given part (parts are separated by semicolon) only if the value fulfills the condition.
Condition can be simple as: [=date], [<>date], [<date], [<=date], [>date], [>=date].
Or the condition can be complex JavaScript formula. The formula can use predefined variables d (day), M (month), y (year), w (week day, 0 = Sunday), h (hours), m (minutes), s (seconds), f (milliseconds). yh (hirji year), Mh (hirji month), dh (hirji day). For compatibility it can use also "=" and "<>" for comparing.
For example: Format: "[y>2010&&y<2015][blue]d.M.yyyy;[y=2018][red]d.M;d.M.yyyy"
[^multi] The format can contain more parts (parts are separated by semicolon) to use the part that is suitable for the date according to its missing fractions (e.g. seconds, time or date, etc.)
The part name in the [ ] can consist from some of these letters (always in this order):
e - used to format value for editing, y - year except current, M - month except current, d - month day except current, h hours except 00, m minutes except 00, s except 00, f milliseconds except 000.
The current year, month and day are compared to DefaultDate or today.
The y, M, d are not set also for 1/1/1970 (ExcelDates = 0) or for 12/31/1899 (ExcelDates = 1).
If the object does not contain attribute for the actual date, the closest attribute is chosen according to the internal algorithm.
For example: "[^yMd]d;[^hms]t;[^ehms]T;[^yMdhms]H" }, for date "1/1/2000" is chosen format "d" from yMd, for date "12:30" is chosen "t" from hms as the closest to hm.
There are also special attributes chosen in special cases:
today - current date without time, yesterday - day before current date without time, tomorrow - day after current date without time, empty - date is null or empty string, zero - date is 0 as time 00:00:00, error - date is not valid date, edit - format used to convert string to date, especially for d,M,y order.

For example: Format: 'dddd, MMMM yyyy hh:mm:ss tt' => "Sunday, February 2004 13:24:00"
Or: Format: '"date:" MM/dd/yyyy", time:" HH:mm" => "date: 10/03/2001, time: 12:34"
Cell, Tool string

EditFormat

GetAttr SetAttr
Format string for editing the date and / or time.
In this format is displayed the Date or Auto (with date) cell when edited.
It is also used for parsing entered date string if it is ambiguous, e.g. "18/04" can be "dd/MM", "MM/dd" or even "yy/MM".
Empty format
If it is not set, it uses Format value.
If it is empty, it accepts all formats like input JSON:
date: yyyy-M-d, M-d, M/d/yyyy, M/d, d.M.yyyy
time: HH:mm, HH:mm:ss, hh.mm, hh.mm.ss, including am/pm, AM/PM, a.m./p.m., A.M./P.M.
If set only time, it cannot be separated by dot.
Standard or user format
Its structure is the same as Format, but not all formats are possible for input, only number inputs are supported.
If set StrictDates 3. bit (&4) (default setting), months can be entered also by their name or shortcut. In this case the separators are not required. The month names can be localized in InputMonthNames.
The format should contains only these parts of custom format: d, dd, DDDD, M, MM, MMM, MMMM, y, yy, yyyy, h, hh, hhh, H, HH, m, mm, mmm, s, ss, sss, t, tt.
All the other unsupported parts of the custom format are removed or converted to supported parts.
The user can use more separators set by InputDateSeparators, InputTimeSeparators and InputDateTimeSeparators.
The am / pm can be localized in InputAMPMDesignators.
If set StrictDates 4. bit (&8) (default setting) the user can also enter the date / time without separators, only as number, in formats like HHmm, HHmmss, MMddyy, MMddyyyy, in the order set in the EditFormat.
Cell, Tool number

TimeZone

[0] GetAttr SetAttr
Value in hours that is added to the cell date value, for display and for editing.
If set to empty string, it is local time zone.
All dates in FastGrid are in UTC (GMT). Use TimeZone to display the UTC date in different time zone.
Cell, Tool object

Calendar

GetAttr SetAttr
Specific definition of Calendar dialog shown for Date type cell to pick up the date.
Format bits

StrictDates

[15]
If and how restricts entering incorrect dates, bit array.
1. bit (&1) - If set, restricts entering incorrect dates by higher or lower values. If not set, accepts also dates like 14/30/2000 converted to 2/30/2001 or 4/-4/2000 converted to 3/27/2000. It is always set for Auto type.
2. bit (&2) - If set, the entered string must contain only date, not any prefix or suffix string. It is always set for Auto type.
3. bit (&4) - If set, permits entering month by its name or shortcut.
4. bit (&8) - If set, permits entering date or time as a number without separators (e.g. "020718" as 2/7/2018), permits 3 (hmm,mss,dMM,Mdd,yMM,Myy), 4 (hhmm,mmss,ddMM,MMdd,MMyy,yyMM), 5 (hmmss,Mddyy,dMMyy,Myyyy), 6 (hhmmss,MMddyy,ddMMyy,yyMMdd,yyddMM,MMyyyy,yyyyMM), 7 (Mddyyyy,dMMyyyy) and 8 (MMddyyyy,ddMMyyyy,yyyyMMdd,yyyyddMM) digits.
5. bit (&16) - If set, permits entering elapsed time (hours>23 or minutes/seconds > 59), but the time cannot be set without separators.
6. bit (&32) - If set, restricts entering single number. It is always set for Auto type.
Format int

DateFormatLowercase

[1]
If set, the months can be set also by 'm' and 24hour hours also by 'h' in the Format string.
The 'm' as month is identified if the format contains d or D or y and does not contain h or H or M.
The 'h' as 24hour hour is identified if the format does not contain t or tt.
If set to 2, it also converts the whole Format to lower case before used.
Grid method string

DateToString

(any date, string format = "", int range = 0, bits type = 0, any default = null, number zone = 0)
Converts date to string according to format string like Format attribute.
date can number or string like date value in V / Value.
If set range, the date can be range string with dates, it is converted to range string with the individual dates formatted.
For range = 2 uses ValueSeparatorDisplay and RangeSeparatorDisplay.
type controls the conversion, bit array:
1.bit &1 - formates slightly differently to use the result for editing.
2.bit &2 - does not return NaN for strings even if the format does not contain "@" part, used for Auto type.
3.bit &4 - returns one NaN for error in range. If not set, replaces by NaN only the incorrect date(s) in the range.
default is default date (permitted formats are the same as for date) to be checked for multi format [^xxxx]. If not set, today 00:00:00 is used.
zone is time zone in hours to be added to the date.
Grid method number

StringToDate

(string string, string format = "", bits range = 0, bits type = 0, any default = null)
Converts string to date number using format string like Format attribute.
For ExcelDates = 0 returns date as number of milliseconds since 1/1/1970 and for ExcelDates = 1 returns date as number of days since 12/31/1899.
For range = 0 the string can contain only one date. For date ranges it returns NaN. Otherwise the range can be bit array:
1. bit &1 - returns parsed date range in string.
2. bit &2 - uses ValueSeparatorDisplay and RangeSeparatorDisplay
3. bit &4 - returns two dymensional array of dates as number of milliseconds [[d11,d12],[d21,d22],...].
4. bit &8 - sorts the range by the first date ascending, joins the adjacent ranges and removes duplicities.
type controls the conversion, bit array:
1.bit &1 - converts strictly, sets StrictDates bits 1, 2 and 5 (1+2+32).
2.bit &2 - does not accept decimal number as date, depending on decimal, date and time separators.
3.bit &4 - returns NaN for error in range. If not set, replaces by NaN only the incorrect dates(s) in the range.
4.bit &8 - does not convert the output dates to ExcelDates if set.
5.bit &16 - accepts input dates also as number of milliseconds (or days for ExcelDates).
default is default date (permitted formats are like date value in V / Value) to be checked used for missing date parts in the string. If not set, today 00:00:00 is used.

Localization

The default date format and setting are specified in Texts.js, in Format object.
The default settings is for English language, changing the Format object attributes you can easily localize it to another language.
Format string[]

ShortDayNames

The week day short names, starting Sunday, used for the format "ddd"
Default is "Sun,Mon,Tue,Wed,Thu,Fri,Sat"
Format string[]

LongDayNames

The week day full names, starting Sunday, used for the format "dddd"
Default is "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"
Format string[]

Day1CharNames

The week day one character names, starting Sunday, used for the format "ddddd"
Default is "S,M,T,W,T,F,S"
Format string[]

Day2CharNames

The week day calendar names, starting Sunday, used in calendar.
Default is "Su,Mo,Tu,We,Th,Fr,Sa"
Format string[]

DayNumbers

The month day numbers 1 - 31, used for the format "dddddd"
Default is "1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th,25th,26th,27th,28th,29th,30th,31st"
Format string[]

ShortMonthNames

The month short names, starting January, used for the format "MMM"
Default is "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"
Format string[]

LongMonthNames

The month full names, starting January, used for the format "MMMM" and also in calendar
These names are expected for month name with day, like 20th January 2000.
Default is "January,February,March,April,May,June,July,August,September,October,November,December"
Format string[]

LongMonthNames2

The month full names, starting January, used for the format "MMMMMMM"
These names are expected for month name without day, like January 2000.
Default is "January,February,March,April,May,June,July,August,September,October,November,December"
Format any

InputMonthNames

[...]
The month names or shortcuts used for entering the month name, starting January, used for StrictDates &4. Case insensitive.
It can contain 12, 24, 36, 48, etc. month names, defined in 12 item sets like "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,Ja,Fe,Ma,Ap,Ma,Jn,Jl,Au,Se,Oc,No,De".
Default is empty to use ShortMonthNames, LongMonthNames and LongMonthNames2 for entering month names.
Format string[]

Quarters

The year quarter names or numbers, used for the format "MMMMM"
Default is "I,II,III,IV"
Format string[]

Halves

The year half names or numbers, used for the format "MMMMMM"
Default is "I,II"
Format string

CalendarMonth

["MMMMMMM yyyy"]
Format to display month and year in calendar header.
Format char

DateSeparator

["/"]
The string displayed in place of '/' in the format string. It is intended to separate date parts.
Format string

InputDateSeparators

["/.-"]
The characters accepted as date separator while editing. Should not contain any character from InputTimeSeparators
Format char

TimeSeparator

[":"]
The string displayed in place of ':'' in the format string. It is intended to separate time parts.
Format string

InputTimeSeparators

[":"]
The characters accepted as time separator while editing. Should not contain any character from InputDateSeparators
Format string

InputDateTimeSeparators

[...]
The characters accepted as separator between date and time while editing. Case insensitive.
Default is any character except digits and InputTimeSeparators and InputDateSeparators, but nothing added to accepted characters for editing Date.
Format string

AMDesignator

["AM"]
The string displayed for dates before noon. It is used only for display.
Format string

PMDesignator

["PM"]
The string displayed for dates after noon. It is used only for display.
Format string[]

InputAMPMDesignators

[...]
AM and PM designator names used accepted for editing. Case insensitive.
It can contain more names defined like "am,pm,a,p,a.m,p.m".
Default is AMDesignator,PMDesignator and also their first character.
Format int

FirstWeekDay

[0]
The starting day of the week, the 0 is Sunday, 1 Monday, ....
It is used by Calendar dialog.
Format int

FirstWeekYearDay

[0]
The first day in week (always from Sunday) to be the week marked as the first week in year.
Set it to 0 for U.S. week numbering and to 3 for ISO/European week numbering.
Set FirstWeekDay accordingly, for standard behavior you should use FirstWeekDay=0 for U.S. numbering and 1 for ISO numbering.
Format string

NaD

["Date error!"]
The string displayed for incorrect date for display.
Format string

NaDRange

["Date range error!"]
The string displayed for incorrect date range for display if set RangeError & 1.
Format string

NaDInput

["e"]
The string displayed for incorrect date or date range for editing.
Format string

NaDFormat

["[red]@"]
Date Format to display the NaD and NaDRange. By default it colors the text red.

Calendar

Date picker dialog done by popup FastGrid defined in Calendar.js.
To show the Calendar on click to icon set LeftIcons or RightIcons or TextIcons = "Date". The Date icon is hidden for not editable cells (see NoEdit).
To show the Calendar on click to the whole cell set Button="Date". It will restrict inline editing of the cell. The calendar dialog is not shown for not editable cell (see NoEdit).

Calendar JSON definition defines its parameters in Script tag, especially date in Script.Dates. The calendar position is defined in Place tag.
The JSON calendar can contain also the same tags as the FastGrid JSON like Cfg or Colors.
Calendar derives FastGrid JSON dialog.
These calendar settings for row / column / cell can be set by Calendar attribute.

To preset some attribute in default calendar in grid, set it like Dialogs: { Calendar: { Script: { Add:2 } } }
Script string

Dates

Initially selected date(s) in the calendar as one date or date ranges string.
The date(s) can be set as number of milliseconds (ExcelDates = 0) or number of days (ExcelDates = 1) or by date string in format "M/d/yyyy HH:mm:ss" or "yyyy-M-d HH:mm:ss".
The ranges are separated by RangeSeparator and ValueSeparator.
Script string

Date

Date (used only month and year) shown in the most left calendar on start.
If not set, the first Dates are shown.
The date(s) can be set as number of milliseconds (ExcelDates = 0) or number of days (ExcelDates = 1) or by date string in format "M/d/yyyy HH:mm:ss" or "yyyy-M-d HH:mm:ss".
Script int

Range

[0]
How many dates can be chosen: 0 - single date, 1 - more ranges, 2 - more single dates, 3 - one range.
Script int

Add

[0]
If and how dates are added to the Range calendar by default left click.
0 - left click clears previously selected dates.
1 - left click adds date range - reverses left click and shift + click.
2 - left click adds single dates - reverses left click and right click / ctrl + click.
Script int

Months

[1/2]
Number of months (calendars) shown, default (for null) is 1 for Range = 0 and 2 for Range > 0.
Script string[]

Buttons

["" / "Ok,Clear"]
Which buttons will be shown on bottom toolbar, it can be comma separated string or array of the button ids. It controls also the button order.
Available buttons: "Ok" - save changes and close calendar, "Cancel" - close calendar without saving changes, "Clear" - clear all the selected dates, "Today" - choose today's date and close calendar.
Default is "" for Range = 0 and "Ok,Clear" for Range > 0.
Script int

ButtonsAlign

[2]
Horizontal alignment of the buttons, 0 - left, 1 - right, 2 - center.
Script bool

WeekNumbers

[1]
If set, shows week numbers in the left column in every month calendar.
Script int

Clear

[2]
If the clear icon is shown in the top left corner of every month calendar, only for WeekNumbers = 1. For 2 the clear icon supports also select all for Range.
Script string

Today

[1]
If set to 1, today's date is marked in the calendar.
It can be set also to date string to mark this date instead of today.
Script bool

MonthEdit

[1]
If set, month and year in the first row can be chosen from list. Otherwise the month and year is displayed readonly according to MonthFormat.
Script string

MonthFormat

["lm"]
Date format string to display month and year in the first row. Only for MonthEdit = 0.
Script int

Time

[0]
If shows time in bottom toolbar, left to Buttons, 0 - no, 1 - edit whole time in edit box, 2 - select time from select boxes, hour, minute and second.
Script int

TimeRound

[1]
How to round the last time units set in TimeFormat, value can be 1, 2, 3, 4, 5, 6, 10, 15, 20, 30 for minutes / seconds or 1, 2, 3, 4, 6, 12 for hours.
For example TimeFormat='15' for TimeFormat="hh:mm" rounds the displayed times to hh:00, hh:15, hh:30, hh:45.
Script string

TimeFormat

["HH:mm:ss"]
Date format string to display and edit time (Time = 1). Affects also select time (Time = 2), but just by presenting HH, HH:mm or HH:mm:ss.
Script int

TimeAlign

[0]
Horizontal alignment of the time cell in bottom toolbar, 0 - left, 1 - right, 2 - center.
Script string

FirstDate

["1/1/2000"]
Minimal date (in string "M/d/yyyy" or "yyyy-M-d" or as number of milliseconds) that can be shown or chosen in the calendar.
Script string

LastDate

["12/31/2030"]
Maximal date (in string "M/d/yyyy" or "yyyy-M-d" or as number of milliseconds) that can be shown or chosen in the calendar.
Script string

Background

["w#1/7/2023~1/9/2023#calweekend"]
Colors given dates, but does not exclude them. By default colors weekends.
The ranges are separated by semicolon, the values by tilde and the repeater and color by '#'.
The format is: repeater1#date1a~date1b#color1;repeater2#date2a~date2b#color2;...
The repeater repeats given date range, it can be one of units:
'ms' - milliseconds, "ms10" - 10 milliseconds, "ms100" - 100 milliseconds,
's' - seconds, 's2' - 2 seconds, 's5' - 5 seconds, 's10' - 10 seconds, 's15' - 15 seconds, 's30' - 30 seconds,
'm' - minutes, 'm2' - 2 minutes, 'm5' - 5 minutes, 'm10' - 10 minutes, 'm15' - quarters of hour, 'm30' - halves of hour,
'h' - hours, 'h2' - 2 hours, 'h3' - 3 hours, 'h6' - quarters of day, 'h8' - thirds of day, 'h12' - halves of day,
'd' - days, 'w' - weeks (starting by FirstWeekDay), 'w0' - weeks (starting by Sunday), 'w1' - weeks (starting by Monday), 'w6' - weeks (starting by Saturday),
'M' - months, 'M2' - (new 10.0) two months, 'M3' - quarters of year, 'M4' - (new 10.0) four months, 'M6' - halves of year,
'y' - years, 'y2' - 2 years, 'y3' - 3 years, 'y4' - 4 years, 'y5' - 5 years, 'y10' - 10 years, 'y20' - 20 years, 'y50' - 50 years (2-50 year is new 10.0)
If repeater is missing, the date is not repeated and specifies one exact range.
Script string

Exclude

Excludes and colors given dates, these dates cannot be selected. Format is the same as in Background.
For example to exclude weekends set Exclude:"w#1/7/2023~1/9/2023#calweekend".
Script bool

RemoveExclude

[1]
If set, removes Exclude dates from inside of selected ranges in Dates.
Script int

UpdateParent

[1]
If set, updates the Parent grid source cell, if shown as dialog for grid cell.
If set to 2, it updates the parent grid source cell in Filter row or column and refilters the grid.
Cfg int

MaxExclude

[10000000] GetCfgAttr SetCfgAttr
Maximal count of excluded units.
Actions

ShowCalendar

(int target = 0) OnClickDate
Shows calendar for actual or focused cell, defined in Calendar attribute.
Grid method object

ShowCalendar

(Row row, Col col)
Shows calendar for the cell row, col, defined in Calendar attribute.
Returns the created FastGrid object.
If the cell already shown the calendar, it closes the calendar and returns false.
Returns null if fails.
API event bool

OnShowCalendar

(Grid grid, Row row, Col col, Dialog calendar)
Called before showed calendar for cell row, col.
calendar is the JSON Calendar object with Script.Dates and Place.
Return true to not display the calendar.
API event void

OnShowedCalendar

(Grid grid, Row row, Col col, Grid calendargrid)
Called after the calendar was shown for given cell.
calendargrid is grid displayed with the calendar cells.