Input hours in Date type field in form

Hello,

I’m building a form to allow the user to enter a date for a custom report. The problem is that the Date type allows to put a day but not hours. (see screenshot). Is it possible to enter times with a date type field?


2023-03-28 14_37_28-SailPoint IdentityIQ - Edit Report - Brave.png

Here is the form definition:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Form PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Form name="Custom-Form-LastUpdatedAccounts" type="Report">
  <Attributes>
    <Map>
      <entry key="pageTitle" value="Custom-Form-LastUpdatedAccounts"/>
    </Map>
  </Attributes>
  <Description>Configuration form for LastUpdatedAccounts report</Description>
  <Section label="Custom options" name="customOptions">
    <Field displayName="Start date" name="startDate" required="true" type="date" value="ref:startDate"/>
    <Field displayName="End date" name="endDate" required="true" type="date" value="ref:endDate">
      <ValidationScript>
        <Source><![CDATA[
          import sailpoint.object.Field;
          import sailpoint.tools.Message;

          List messages = new ArrayList();

          Field startDateField = form.getField("startDate");
          Date startDate = startDateField.getValue();
          if (startDate != null && (startDate.after(value) || startDate.equals(value)))
          {
            messages.add(Message.localize("End date must be after the start date")); 
          }
          return messages;
        ]]></Source>
      </ValidationScript>
    </Field>
  </Section>
</Form>

Thank you in advance for your help.

Mathieu G

IIQ OOTB date widget allows to enter day/month/year part, not time (default 12 AM GMT). You may create manual dropdown fields to capture time component and use Java Calendar API to incorporate time part.

Thank you  @kalyankumar_saha  , I will follow your advice.

Regards,

Mathieu G

Also  @kalyankumar_saha  do you know if it is possible to have multiple argument for one parameter in my custom report ?

For example, now I will have a startDate (date), a startHour (int) and a startMinutes (int) in my Form, I want to build a filter with theses 3 arguments with only one parameter. Until today I was only using startDate so no problem but now with 3 arguments I feel like I’m forced to have 3 parameters. For the moment I think about creating another field combining the 3 fields into one and have one argument.

To explain my question I have the following datasource :

<DataSource objectType="sailpoint.object.AuditEvent" type="Filter">
	<QueryParameters>
		<!-- A Parameter can have properties and/or a QueryScript. -->
		<Parameter>
			<QueryScript>
				<Source>
				<![CDATA[
				// Query Scripts are passed in 3 things into context:
				// 1) The "value" of the paramter entered in the Form
				// 2) The "queryOptions" that that filters the data
				// 3) The "context" provided to all Rule/BeanShell.

				import sailpoint.object.QueryOptions;
				import sailpoint.object.Filter;

				// The first step is to build the AuditEvent filter. It will include AuditEvent with action = identityLifecycleEvent and String1 = "XXXX".
				List filterAuditResults = new ArrayList();
				filterAuditResults.add(Filter.eq("action", "identityLifecycleEvent"));
				filterAuditResults.add(Filter.eq("string1", "XXXX"));
				queryOptions.addFilter(Filter.and(filterAuditResults));

				return queryOptions;
				]]>
				</Source>
			</QueryScript>
		</Parameter>
		<Parameter argument="startDate">
			<QueryScript>
				<Source>
				<![CDATA[
				import sailpoint.object.QueryOptions;
				import sailpoint.object.Filter;

				// The second step is to build the startDate filter
				queryOptions.addFilter(Filter.ge("created", value));
				return queryOptions;
				]]>
				</Source>
			</QueryScript>
		</Parameter>
		<Parameter argument="endDate">
			<QueryScript>
				<Source>
				<![CDATA[
				import sailpoint.object.QueryOptions;
				import sailpoint.object.Filter;

				// The third step is to build the endDate filter
				queryOptions.addFilter(Filter.le("created", value));
				return queryOptions;
				]]>
				</Source>
			</QueryScript>
		</Parameter>
	</QueryParameters>
</DataSource>