[midPoint] Adding days/hours/minutes to validTo in midpoint and date/time formatting in the UI

Davy Priem davy.priem at vives.be
Thu Nov 17 13:37:38 CET 2022


Hi Kevin,

Midpoint has buildin functions for date manipulation:
	timestamp = basic.parseDateTime("yyyy-MM-dd HH:mm:ss.S",HRendDate);
	 return basic.roundUpToEndOfDay(timestamp);

For documentation regarding buildin functions, see https://docs.evolveum.com/midpoint/reference/expressions/expressions/script/functions/


Best regards,
Davy

-----Oorspronkelijk bericht-----
Van: midPoint <midpoint-bounces at lists.evolveum.com> Namens Collins, Kevin via midPoint
Verzonden: Thursday, 17 November 2022 12:32
Aan: midpoint at lists.evolveum.com
CC: Collins, Kevin <K.J.Collins at hw.ac.uk>
Onderwerp: [midPoint] Adding days/hours/minutes to validTo in midpoint and date/time formatting in the UI

Hi everyone,


I've got stuck again in putting together a midpoint proof-of-concept and I would really appreciate some help.

The problem is this. Inbound data from HR to the IDM might contain an end_date. If the end_date is null or empty the user has not indicated that they are leaving. If the end_date has a value then that value is a date in the form 'yyyy-MM-dd' and is the person's last working day.
If I map this to $focus/activation/validTo in schemaHandling in the resource the value goes in without complaint and shows up in midpoint/User/activation. MidPoint, though, assumes a date of 12:00AM and so would disable the user account at the _start_ of the working day rather than at the end.  How can I add 23h59m onto the end_date so that the departing user still has access on their last day?

Second issue I'm having, since I've been poking about in dates/times...
Is it possible to make dates/times in midPoint show dates and times in UK English form (dd/MM/yyyy) rather than the US format (MM/dd/yyyy) and, similarly to have times show in 24-hour clock form rather than 12-hour with AM/PM indication?

Thanks in advance for any help you can give me.


-Kev_C


--
Kevin Collins
EDINBURGH, EH14 4AS,
Scotland, UK
________________________________

Founded in 1821, Heriot-Watt is a leader in ideas and solutions. With campuses and students across the entire globe we span the world, delivering innovation and educational excellence in business, engineering, design and the physical, social and life sciences. This email is generated from the Heriot-Watt University Group, which includes:

  1.  Heriot-Watt University, a Scottish charity registered under number SC000278
  2.  Heriot- Watt Services Limited (Oriam), Scotland's national performance centre for sport. Heriot-Watt Services Limited is a private limited company registered is Scotland with registered number SC271030 and registered office at Research & Enterprise Services Heriot-Watt University, Riccarton, Edinburgh, EH14 4AS.

The contents (including any attachments) are confidential. If you are not the intended recipient of this e-mail, any disclosure, copying, distribution or use of its contents is strictly prohibited, and you should please notify the sender immediately and then delete it (including any attachments) from your system.
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.evolveum.com%2Fmailman%2Flistinfo%2Fmidpoint&data=05%7C01%7Cdavy.priem%40vives.be%7C50b501b5601945c99e2a08dac88f5736%7Cbb238cf566c946069852a9f3e1782d63%7C1%7C0%7C638042815214451028%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gcZcNuVnsA5Npw0xu7RBuVEv8xB1CLiWBeBWtrBl0Ig%3D&reserved=0


More information about the midPoint mailing list