I would consider adding 2 columns: one text column to enter the date and a composite column to display it.
You would enter the date using some version of a string that supplies the numbers and the desired format. Example:
Y,1984
YM,1984,12
YMD,1984,12,04
The template for the composite column would split the "list" into its component parts then reassemble them as desired. Something like:
Code:
program:
# date_string = field('#other_column')
date_string = 'YMD,1984,12, 01';
format = list_item(date_string, 0, ',');
if format == 'YMD' then
strcat(
list_item(date_string, 1, ','), '-',
list_item(date_string, 2, ','), '-',
list_item(date_string, 3, ',')
)
elif format == 'YM' then
strcat(
list_item(date_string, 1, ','), '-',
list_item(date_string, 2, ',')
)
elif format == 'Y' then
list_item(date_string, 1, ',')
else
'Invalid Format'
fi