Skip to content

Date Formats Customization

The Date Format Customizer in Paymattic allows you to control how dates are displayed in your forms, reports, emails, and receipts.

Overview

This guide explains how to customize date and time formats in Paymattic's Date & Time fields. Paymattic uses flatpickr for powerful date/time handling.

Quick Reference

Common Date Formats

FormatExampleCode
US Format12/31/2023"m/d/Y"
EU Format31/12/2023"d/m/Y"
ISO Format2023-12-31"Y-m-d"
Full TextSunday, December 31, 2023"l, F j, Y"
Short TextSun, Dec 31, 2023"D, M j, Y"

Common Time Formats

FormatExampleCode
12-hour2:30 PM"h:i K"
24-hour14:30"H:i"
With Seconds2:30:45 PM"h:i:s K"

Date Format Characters

CharacterDescriptionExample
dDay with leading zeros01 to 31
DShort day nameMon through Sun
lFull day nameSunday through Saturday
jDay without zeros1 to 31
JDay with ordinal1st, 2nd, to 31st
wDay of week (number)0 (Sun) to 6 (Sat)
WWeek of year0 to 52
FFull month nameJanuary through December
mMonth with zeros01 through 12
nMonth without zeros1 through 12
MShort month nameJan through Dec
UUnix timestamp1413704993
y2-digit year99 or 03
Y4-digit year1999 or 2003
ZISO date format2017-03-04T01:23:43.000Z

Time Format Characters

CharacterDescriptionExample
H24-hour format00 to 23
h12-hour format1 to 12
GHours with zeros01 to 12
iMinutes00 to 59
SSeconds with zeros00 to 59
sSeconds without zeros0 to 59
KAM/PM indicatorAM or PM

Advanced Configuration

Paymattic Date and Time field use flatpickr JS library; for advanced users, you can provide the config object in the field’s advanced settings.

Advanced settings

Basic Settings

OptionTypeDefaultDescription
dateFormatString"Y-m-d"Date display format
enableTimeBooleanfalseShow time picker
modeString"single""single", "multiple", or "range"
defaultDateString/ArraynullInitial selected date(s)
minDateString/DatenullEarliest selectable date
maxDateString/DatenullLatest selectable date

Time Settings

OptionTypeDefaultDescription
enableSecondsBooleanfalseShow seconds input
time_24hrBooleanfalseUse 24-hour format
defaultHourNumber12Initial hour value
defaultMinuteNumber0Initial minute value
hourIncrementInteger1Hour selection step
minuteIncrementInteger5Minute selection step

Display Settings

OptionTypeDefaultDescription
inlineBooleanfalseShow calendar permanently
staticBooleanfalseFix calendar position
positionString"auto"Calendar placement ("auto", "above", "below")
showMonthsInteger1Number of months displayed
weekNumbersBooleanfalseShow week numbers
shorthandCurrentMonthBooleanfalseUse short month names

Input Settings

OptionTypeDefaultDescription
allowInputBooleanfalseAllow manual date entry
clickOpensBooleantrueOpen on input click
wrapBooleanfalseSupport custom elements
altInputBooleanfalseShow formatted date
altFormatString"F j, Y"Display format when altInput is true
disableMobileBooleanfalseForce desktop picker on mobile

Custom Week Start

Set the first day of the week using:

json
{
    "locale": {
        "firstDayOfWeek": 1  // 0 = Sunday, 1 = Monday
    }
}

Examples

Common configurations:

  1. Date only: { "dateFormat": "Y-m-d" }
  2. Date + Time: { "dateFormat": "Y-m-d H:i", "enableTime": true }
  3. Range picker: { "mode": "range", "dateFormat": "Y-m-d" }
  4. Multiple dates: { "mode": "multiple", "dateFormat": "Y-m-d" }

Important

When using advanced settings:

  1. Use valid JSON format
  2. Test thoroughly after changes
  3. Consider mobile users when customizing

Need Help?

For complete configuration options, see flatpickr's documentation. If you need assistance, contact our support team.

Released under the GPL License.