I found the way around the problem with MC's way to format date in hours and days with this string should take care of files with '
xx.x hours' in output of elapsed time of import:
If(IsEqual(Mid(FormatDate([Date Imported,0],elapsed),5,5),hours,1),1. Last 2 days(not completely sure, but it seems that after 48
hours the output comes as '
days'
This string gets the Date Imported in elapsed format and reads five characters of it, starting from the fifth. If it says "hours", than this file belongs to "1. Last 2 days" category. You will see below in the code that I added similar string for files with
hh:mm:ss in the elapsed date of import - it reads third character, and if there is ":", than it belong to "0. Today" category.
So, my pane 'Import History' looks like that now:
Go to
Audio view with Panes, enter the
Edit View Scheme screen and add new view item (use 'Advanced Expression' when asked), name it "Import History" and copy'n'paste the below expression in the text box.
and this is the code:
If(IsEqual(FormatDate([Date Imported,0],elapsed),1d,4),0. Today,If(IsEqual(Mid(FormatDate([Date Imported,0],elapsed),2,1),:,1),0. Today,If(IsEqual(Mid(FormatDate([Date Imported,0],elapsed),5,5),hours,1),1. Last 2 days,If(IsEqual(FormatDate([Date Imported,0],elapsed), 7d, 4),2. Last Week,If(IsEqual(FormatDate([Date Imported,0],elapsed), 31d, 4),3. Older than one week,If(IsEqual(FormatDate([Date Imported,0],elapsed), 184d, 4),4. Older than one month,If(IsEqual(FormatDate([Date Imported,0],elapsed), 365d, 4),5. Older than half a year,6. Older than year)))))))I really hope it'll work with others too. Let me know, I would like to clean up thist thread after we done here.
P.S. As you can see on the picture, I got the
'Imported (ago)' working correctly as well, though coud not sort it correctly, because it sorts as numeric values, so 3 hours will come next to 2 days. But this field is not needed now; I don't use it in
'Import History' pane. There is a code for this one:
If(IsEqual(Mid(FormatDate([Date Imported,0],elapsed),5,5),hours,1),Mid(FormatDate([Date Imported,0],elapsed),0,2) hours,If(IsEqual(Mid(FormatDate([Date Imported,0], elapsed),2,1),:,1),Mid(FormatDate([Date Imported,0],elapsed),0,2) hours,FormatNumber(FormatDate([Date Imported,0],elapsed),0) days))