Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jul 02, 2020 04:57 AM
I noticed the date value provided is structured as M/D/YYYY. Is this consistent across all users? Or does this change depending on regions? ie. D/M/YYYY for EMEA Airtable users, M/D/YYYY for US Airtable users, etc.
This might be a new Feature Request, but it would be awesome if CellRenderer can provide an easy Field type toggle to generate more consistent “universal” dates. I would love to see something like YYYY-MM-DD being available.
Solved! Go to Solution.
Jul 02, 2020 11:44 AM
Hi @Mixable,
The cell value returned when reading a date cell (via record.getCellValue('dateField')
) will always be an ISO 8601 formatted date string (YYYY-MM-DD).
If you instead call record.getCellValueAsString()
, it will return a date string with formatting dependent on the underlying field configuration. There are 5 supported date formats: local, friendly, ISO, US, and European. <CellRenderer />
respects the field configuration as well, and will render this formatted string.
This field option can be configured via the main Airtable UI (by double-clicking on the field name), or via custom blocks using the field.updateOptionsAsync metadata API.
For more information about expected cell formats & field options, you can check out the FieldType
enum in the API docs here.
Hope this helps!
Jul 02, 2020 11:44 AM
Hi @Mixable,
The cell value returned when reading a date cell (via record.getCellValue('dateField')
) will always be an ISO 8601 formatted date string (YYYY-MM-DD).
If you instead call record.getCellValueAsString()
, it will return a date string with formatting dependent on the underlying field configuration. There are 5 supported date formats: local, friendly, ISO, US, and European. <CellRenderer />
respects the field configuration as well, and will render this formatted string.
This field option can be configured via the main Airtable UI (by double-clicking on the field name), or via custom blocks using the field.updateOptionsAsync metadata API.
For more information about expected cell formats & field options, you can check out the FieldType
enum in the API docs here.
Hope this helps!
Jul 02, 2020 11:52 AM
Thank you @Billy_Littlefield!