Defining the data-format of a column

If you set the data-format on a column, Organizer will apply some appropriate formatting for you.

Certain formats also change how the filter options work; for example if you say that a column is a date, the administrator will be able to filter using a date picker.

Note that you can't use both the format and item_link properties together.

Possible options are:

date and datetime

These accept a date or datetime, which needs to be in either UNIX time (i.e. the number of seconds since the 1st of January 1970) or raw MySQL format (i.e. YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).

They output either a date or a datetime, formatted as per the site settings.

enum

Given a value from the list of values defined in the values property on a column, this will display the display value.

filesize

Given a number in bytes, this will format it in KB/MB/GB/TB as appropriate, rounding to one decimal place.

id

This indicates that this column is an id column. If it is made searchable, only exact matches will be returned (instead of using LIKE as normal).

language_english_name and language_english_name_with_id

Given a language code, these will look up and display the English name of the language if it is stored in the system. The language_english_name_with_id option will also add the language code at the end in brackets.

module_class_name

Given the id, directory name or class name of a Module, this will display its display name.

remove_zero_padding

This will remove zero-padding from numbers. It works on strings as well; if a string contains any zero-padded numbers, then the zeros will be removed when the string is displayed.

yes_or_no

These format a field depending on whether or not the value is empty.

Implications for Searching

When searching client-side, it is the formatted values that will be searched on, and not the values before they were formatted.

However when searching server-side it is the raw values in the database that are searched on. If this could cause confusion you should not make this column searchable.

Implications for Sorting

When sorting it is the original values which are sorted on, and not the formatted values.

For some formatting options this could possibly cause some confusion; e.g. Welsh (cy) would appear alphabetically before English (en), which itself would be before Chinese (zh).

Implications for Filtering

Usually when a column is searchable and filterable (columns are filterable unless they have the disallow_filtering property set) then the default behaviour is a text search.

If a field is a date/datetime field, it will have a date-range picker instead.

If a field is a yes_or_no field, it will have a yes/no picker instead.

If a field is an enum, it will have a list of values instead.

Spaces

Most of the options will only work on the first word. That means if you have a space in one of your values, everything after the space will be left as-is.

date, datetime and remove_zero_padding are exceptions and will attempt to use your whole value.

Reference for format: