Date and Time Duplicate Validator

Introduction

The Date and Time Duplicate Validator is a form validator plugin designed to check for conflicts in date and time fields. It is particularly useful in applications like the Meeting Room Booking App, where overlapping time slots must be avoided.

You can access the source code for this plugin on JogetOSS GitHub. JogetOSS is a community-led team for open-source software related to the Joget no-code/low-code application platform. Projects under JogetOSS are community-driven and community-supported, and you are welcome to contribute in the projects.

Get started

Configure date and time duplicate validator

This validator is configured in the form element properties, specifically under Edit Date Picker > Validator > Date and Time Duplicate Validator. To function correctly, the validator requires the Start Date and End Date field IDs, which must already exist in your form.

Fields to configure:

  • Start Date Field ID *: Field ID for From date range. This field is mandatory.
  • End Date Field ID *: Field ID for To date range. This field is mandatory.
  • Data Format *: In Java date format; e.g., yyyy-MM-dd for 2011-06-01. This field is mandatory.
  • Display Format *: See Datepicker Widget. This field is mandatory.
  • Validation Error Message *: Custom error message to display for duplicate value found. This field is mandatory.
  • Mandatory: When checked, the field must be filled. 
  • Mandatory Error Message *: Custom error message to display for duplicate value found.

Filter

  • Resource Field ID: Specify the Field ID to validate the availability of a resource during the specific time
  • Filter Conditions: Define the conditions under which the filter applies.
    • Join Type: 
      • And
      • Or
    • Field: Specify the Field ID to apply the filter (e.g., title).
    • Operator: Select an operator.
      • Equal
      • Not Equal
      • Greater Than
      • Greater Than Or Equal
      • Less Than
      • Less Than Or Equal
      • Like
      • Not Like
      • In
      • Not In
      • Is True
      • Is False
      • Is Null
      • Is Not Null
    • Value: Provide the value for the filter.
  • Extra Conditions: Add additional filtering conditions using HQL (Hibernate Query Language).
    Syntax Query
    Start your filter name with e.customProperties. followed by the field id (i.e. title)

    HQL is accepted
    You may even use an operator such as LIKE to narrow down your data set.
    Sample
    e.customProperties.title = 'Trip'

    A hash variable is accepted here.

    Sample
    e.customProperties.submitted_by = '#currentUser.id#'

    Userview Key can be used as part of the condition.

    Sample
    e.customProperties.category_id = '#userviewKey#'

Download plugin

Download sample app

Download the demo app for Date and Time Duplicate Validator:
Created by Julieth Last modified by Aadrian on Nov 19, 2024