'year' long (2,019) to 'year_alias' ('2019-01-01')

Field 'year' automapped to long ("2019" --> "2,019")

How to convert, script, alias, painless, whatever into a field that acts as a proper year?

I tried a scripted field with:
new SimpleDateFormat('yyyy-MM-dd').parse(doc['year'].value + "-01-01").getTime();

It seems to work -- any better ideas than doing this?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.