order by custom jcr property name in Query Builder
Hello Everyone,
I am trying to order my content based on last modified order in descending. Below code works fine
Map<String, String> param = new HashMap<>();
param.put("p.limit", 1);
param.put("p.guessTotal", "true");
param.put("type", "cq:PageContent");
param.put("path", "/content/abc/myarticles/en");
param.put("2_property", "customType");
param.put("2_property.1_value", "article");
param.put("orderby", "@cq:lastModified"); // this is of type: Date, This works fine.
param.put("orderby.sort", "desc");
Now, instead of @5644378:lastModified field, I am trying to use custom field: customPublishTime
param.put("orderby", "@customPublishTime");
sample value of customPublishTime is: 2022-03-04T00:00:00.000+05:30 This is of type: String.
But this is not working. Since, for some reason, I cannot modify the type of customPublishTime from String to Date.
So, while writing the code for Hashmap Parameter, is it possible to convert the custom field type to Date?
Thanks in advance.