# Input hours in Date type field in form

**URL:** <https://community.sailpoint.com/discuss/t/input-hours-in-date-type-field-in-form/29645>\
**Category:** Implement & Extend\
**Tags:** uiux, search-reports\
**Created:** [March 28, 2023, 12:47pm UTC](https://community.sailpoint.com/discuss/t/input-hours-in-date-type-field-in-form/29645 "2023-03-28T12:47:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathieug](https://sea3.discourse-cdn.com/sailpoint2/discuss/user_avatar/community.sailpoint.com/mathieug/32/17366_2.png) [@mathieug](https://community.sailpoint.com/discuss/u/mathieug)\
**Post date:** [March 28, 2023, 12:47pm UTC](https://community.sailpoint.com/discuss/t/input-hours-in-date-type-field-in-form/29645/1 "2023-03-28T12:47:45Z")

</div>

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](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/sailpointsbx2/original/2X/f/fd1eb504e6bd6a7c74281edb188b2170b91dad66.png)  
2023-03-28 14\_37\_28-SailPoint IdentityIQ - Edit Report - Brave.png

Here is the form definition:

```markup
<?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

---

<div class="post-metadata">

**Author:** ![kalyankumar\_saha](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@kalyankumar\_saha](https://community.sailpoint.com/discuss/u/kalyankumar_saha)\
**Post date:** [March 28, 2023, 1:06pm UTC](https://community.sailpoint.com/discuss/t/input-hours-in-date-type-field-in-form/29645/2 "2023-03-28T13:06:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mathieug](https://sea3.discourse-cdn.com/sailpoint2/discuss/user_avatar/community.sailpoint.com/mathieug/32/17366_2.png) [@mathieug](https://community.sailpoint.com/discuss/u/mathieug)\
**Post date:** [March 28, 2023, 1:23pm UTC](https://community.sailpoint.com/discuss/t/input-hours-in-date-type-field-in-form/29645/3 "2023-03-28T13:23:26Z")

</div>

Thank you&nbsp; @kalyankumar_saha &nbsp;, I will follow your advice.

Regards,

Mathieu G

---

<div class="post-metadata">

**Author:** ![mathieug](https://sea3.discourse-cdn.com/sailpoint2/discuss/user_avatar/community.sailpoint.com/mathieug/32/17366_2.png) [@mathieug](https://community.sailpoint.com/discuss/u/mathieug)\
**Post date:** [March 28, 2023, 1:43pm UTC](https://community.sailpoint.com/discuss/t/input-hours-in-date-type-field-in-form/29645/4 "2023-03-28T13:43:45Z")

</div>

Also&nbsp; @kalyankumar_saha &nbsp;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 :

```markup
<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>

```
