The publish date search allows you to find posts/locations published after/before/within a specific period/date. What’s cool about this search tool is that it provides two search options that you’ll discover below. To add the publish date search to your form, follow these steps:
- Edit your search form
- Click on the menu “Publish date search”
- In the field “Use publish date search option?”, select the option “Yes”
- In the field “Title”, enter the title of the publish date search field (the field label).
- In the field “Description”, enter the description of the publish date search field (the field description).
- Read the following before saving the search form …
1. Search by predefined periods
The “predefined periods” search allows you to find posts/locations added after and/or before specific number of hours, days, months and/or years. By using this option, a select list that contains your predefined periods will be added to your search form.
To activate this options, follow these steps:
- In the field “Publish date search type”, select the option “Predefined periods”
- Scroll down to the section “Predefined periods parameters” and click on the group field “Predefined periods”
- In the field “Period Title”, enter the title of your predfined period (e.g. “Anytime”, “Last 24 hours”, “Last 7 days”)
- In the field “Period Length”, specify the length of your predefined period. The length can be expresed with hours, days, months and/or years.
- In the field “Period type”, define your predefined period type.
- “Before x hours”: This option allows to find posts/locations published before specific hours.
- “After x hours”: This option allows to find posts/locations published after specific hours.
- “Before x days”: This option allows to find posts/locations published before specific days.
- “After x days”: This option allows to find posts/locations published after specific days.
- “Before x months”: This option allows to find posts/locations published before specific months.
- “After x months”: This option allows to find posts/locations published after specific months.
- “Before x years”: This option allows to find posts/locations published before specific years.
- “After x years”: This option allows to find posts/locations published after specific years.
- To add another predefined period, click on the button “Add new predefined period” and repeat the steps 3, 4 and 5.
- Save your search form
2. Search by date or date range
The “date/date range” search allows you to find posts/locations added after/before a date and/or between two dates. By using this option, a datepicker will be added to your search form.
To activate this options, follow these steps:
- In the field “Publish date search type”, select the option “Date/Date range”
- Scroll down to the section “Posts publish date parameters” and click on the group field “Datepicker parameters”
- In the field “Search by”, select a search option:
- “Exact date”: This option allows you to find posts/locations published on the selected date.
- “After date”: This option allows you to find posts/locations published after a specific date.
- “Before date”: This option allows you to find posts/locations published before a specific date.
- “Between two dates”: This option allows you to find posts/locations published between two dates.
- Choose the date format of the datepicker in the field “Date format”.
- In the field “Exclude date attributes” you can remove one or more attributes from the date. For example, to remove the day number from the datepicker, select the option “Day”.
- In the field “Start date” you can specify the minimum date of the datepicker. All dates before the start date will be disabled.
- In the field “End date” you can specify the maximum date of the datepicker. All dates after the end date will be disabled.
- In the field “Start view”, select the start view of the datepicker. For example, to load the datepicker on years, select the option “Years”.
- Select the week start of the datepicker in the field “Week start”.
- To automatically open the datepicker on page load, select the option “Yes” in the field “Auto show”.
- To automatically close the datepicker after selecting a date, select the option “Yes” in the field “Auto hide”.
- Save your search form