Hi Community,
I have met a problem when trying to filter object list by Last Change attribute and need your help.
The story is that user want to obtain all objects, like function, cluster/data model and position, which are modified after a specified date. To accomplish this, I plan to create a report which pops up a dialog box asking for the date and then uses this date to filter objects.
However, I found the data type of attribute Last Change(Attribute(Constants.AT_LAST_CHNG_2, nLocale)) is not Date(in javascript) and it doesn't provide method to convert it into Date type. After further study, I got the class of Last Change, AAttributeTimeStampDef.
Does any one know about class AAttributeTimeStampDef? Or know how to convert Last Change to Date?
Thanks in advance.
Regards,
Will
Julien Letellier on
Hi Will,
I had the same problem when I was trying to get the attribute "Constants.AT_REL_ON" of a model. I didn't find a solution so I wrote a function to convert the aris date format (which seems to be the german format, at least for me) into JavaScript Date type.
/** * Converts the aris date format into a JavaScript Date type */ function parseArisDate(arisDate) { var newDate = new Date(); if (arisDate.length() == 10 || arisDate.length() == 19) { newDate.setDate(arisDate.substr(0, 2)); newDate.setMonth(arisDate.substr(3, 2) - 1); newDate.setYear(arisDate.substr(6, 4)); } if (arisDate.length() == 19) { newDate.setHours(arisDate.substr(11, 2)); newDate.setMinutes(arisDate.substr(14, 2)); newDate.setSeconds(arisDate.substr(17, 2)); } return newDate; }Hope this little helper is useful.