Thread: Imprecise Dates
View Single Post
Old 01-01-2021, 11:10 PM   #2
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
You could use a composite column with conditional formatting. Problem is how would you tell whether a date like 1985-01-01 is an actual date or a pretend date?

If you will presume that every date that starts with 01-01 is a pretend date, a template like this should work:

Code:
program:
	m = format_date(field('timestamp'), 'M');
	d = format_date(field('timestamp'), 'd');
	if m == 1 then
		if d == 1 then
			format_date(field('timestamp'), 'yyyy')
		else
			format_date(field('timestamp'), 'dd-MM-yyyy')
		fi
	else
		format_date(field('timestamp'), 'dd-MM-yyyy')
	fi
capink is offline   Reply With Quote