Skip to content

Commit

Permalink
Add support for custom date fields in the entry table. See GitHub Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Jul 21, 2024
1 parent 8f7306f commit 4779b78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ as long as it is in the permitted set, ie a letter, number or underscore.
restrictions on the characters allowed in order to simplify the code. For
a technical explanation see below).

At the moment only text, varchar, date (user table only), decimal/numeric,
int, smallint and tinyint columns are supported, displayed as textarea, text,
date, number or checkbox fields as appropriate. Whether a varchar is displayed
as a text or textarea input depends on its maximum length, with the breakpoint
At the moment only text, varchar, date, decimal/numeric, int, smallint and
tinyint columns are supported, displayed as textarea, text, date, number
or checkbox fields as appropriate. Whether a varchar is displayed as a text
or textarea input depends on its maximum length, with the breakpoint
determined by a configuration variable. Ints are treated as integer types, as
you would expect. However smallints and tinyints are assumed to be booleans
and are displayed as checkboxes.
Expand Down
4 changes: 4 additions & 0 deletions web/edit_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ function get_field_custom(string $key, bool $disabled=false)
// HTML5 does not allow a pattern attribute for the textarea element
$class = 'FieldTextarea';
}
elseif ($custom_field['type'] == 'date')
{
$class = 'FieldInputDate';
}
// Otherwise check if it's an integer field
elseif ((($custom_field['nature'] == 'integer') && ($custom_field['length'] > 2)) ||
($custom_field['nature'] == 'decimal'))
Expand Down

0 comments on commit 4779b78

Please sign in to comment.