HI ,
I need to set date type programmatically in crx repo so that it should work with both classic and touch UI datepicker.
Currently I am setting up as a string "Fri Dec 04 2020 13:08:08 GMT-0700" which is working for classic but not for Touch UI.
I have tried with using SimpleDateFormat (below format) to format string (eg) "2020-12-23T03:15:00.000+05:30" it as date object but getting as null in crx.
yyyy-MM-dd'T'HH:mm:ss.SSSXXX
Please let me know how to proceed here.
THanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Harsh161987 ,
please use below code to set date property to node.
String dateString = "your_date"
Calendar cal = new GregorianCalendar();
cal.setTimeZone(TimeZone.getDefault());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
cal.setTime(formatter.parse(dateString))
node.setProperty("date", cal );
Thanks,
Sandeep.
Hi @Harsh161987 ,
Can you please share code snippet the way you are setting this date property value.
Hi @Harsh161987 ,
please use below code to set date property to node.
String dateString = "your_date"
Calendar cal = new GregorianCalendar();
cal.setTimeZone(TimeZone.getDefault());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
cal.setTime(formatter.parse(dateString))
node.setProperty("date", cal );
Thanks,
Sandeep.
Views
Likes
Replies
Views
Likes
Replies