06-22-2016 09:17 AM
Hello,
I have made a custom Aikau page showing all custom aspects of some documents in table form. Two of the custom aspects are of the type d:date. When I display the aspects on the Aikau page using the
alfresco/renderers/Property
widget, the date is showing as:
Zo 5 jun 2016 00:00:00
I would like to display the dates as 5 jun 2016 or 5-06-2016
I have already tried to change the share date notation in
common.properties
, but this was not helping. There also is a
renderDate
method within the
alfresco/renderers/Property
but Iam not sure how to call this method and Iam not sure it is working/implemented at all.
How can i change the date format on my custom Aikau page
With kind regards,
Remco
06-23-2016 10:52 AM
define(["dojo/_base/declare",
"alfresco/renderers/Property"
],
function(declare, Property) {
return declare([Property], {
requiredDateFormat: null,
/**
* Renders a date property using the either the format argument or
* requiredDateFormat as the date format. requiredDateFormat will take
* preference if set
*
* @instance
*/
renderDate: function(date, format) {
preferredFormat = (this.requiredDateFormat ? this.requiredDateFormat : format)
return this.formatDate(this.fromISO8601(date), preferredFormat);
}
});
});
09-15-2016 05:42 AM
steven.okennedy _ is correct in that no version of Aikau supports what you require (at the time of writing the latest version available is 1.0.85 - if you're reading this any time after 15th Sept 2016 then you may want to check what is available in later releases!)
However, the preferred approach here would be for you to raise an issue on the GitHub project to make us aware of your requirement and then we can actually do something about it. Better yet, rather than just writing a custom widget yourself you could make updates to the existing widgets or add an entirely new widget and contribute it back to the project as a pull request. There is a new backwards compatibly Aikau release on a weekly basis so you wouldn't need to wait very long to take advantage of your contribution.
This ensures that others will also be able to benefit from the addition - it also means that Aikau team will need to support it going forwards which will ensure that your usage of the widget is future proof.
09-22-2016 10:44 AM
I've created a blog post explaining how a feature like this can be contributed back. I've raised a PR and the solution should be available from Aikau 1.0.88
10-19-2016 05:56 AM
Dave,
Thanks for your blog and your PR. I have installed Aikau 1.0.90 and used the format property. Ever things works fine now, I can totally control the format of date/time. Either bij keywords (isoDate, shortDate) or by variables (dd-mm-yy).
Thanks again.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.