WPSolr logo
  • Hundreds of brands you love, love WPSOLR 💛
  • Products
    • Parsing & Chunking
    • Search
      • Algolia  Search
      • Apache Solr  Search
      • Elasticsearch  Search
      • Google AI Commerce  Search
      • OpenSearch  Search
      • OpenSolr  Search
    • AI Search
      • OpenSearch  AI Search
      • PostgreSQL  AI Search
      • Vespa  AI Search
      • Weaviate  AI Search
    • AI Recommendations
      • Amazon Personalize  AI Recommendations
      • Recombee  AI Recommendations
    • AI Personalized Search & Recommendations
      • Algolia  AI Personalized Search & Recommendations
      • Google AI Commerce  AI Personalized Search & Recommendations
  • Learn
    • Documentation & Guides – Everything to get started fast
    • Youtube – 100 practical videos from setup to live site demos
    • Forums – Direct support from our team
  • Pricing
  • My licenses
  • Meet
  • 📞  Call
    • 📞  US : (951) 612-8259
    • 📞  France : 01 62 04 55 85
  • Hundreds of brands you love, love WPSOLR 💛
  • Products
    • Parsing & Chunking
    • Search
      • Algolia  Search
      • Apache Solr  Search
      • Elasticsearch  Search
      • Google AI Commerce  Search
      • OpenSearch  Search
      • OpenSolr  Search
    • AI Search
      • OpenSearch  AI Search
      • PostgreSQL  AI Search
      • Vespa  AI Search
      • Weaviate  AI Search
    • AI Recommendations
      • Amazon Personalize  AI Recommendations
      • Recombee  AI Recommendations
    • AI Personalized Search & Recommendations
      • Algolia  AI Personalized Search & Recommendations
      • Google AI Commerce  AI Personalized Search & Recommendations
  • Learn
    • Documentation & Guides – Everything to get started fast
    • Youtube – 100 practical videos from setup to live site demos
    • Forums – Direct support from our team
  • Pricing
  • My licenses
  • Meet
  • 📞  Call
    • 📞  US : (951) 612-8259
    • 📞  France : 01 62 04 55 85
  • Hundreds of brands you love, love WPSOLR 💛
  • Products
    • Parsing & Chunking
    • Search
      • Algolia  Search
      • Apache Solr  Search
      • Elasticsearch  Search
      • Google AI Commerce  Search
      • OpenSearch  Search
      • OpenSolr  Search
    • AI Search
      • OpenSearch  AI Search
      • PostgreSQL  AI Search
      • Vespa  AI Search
      • Weaviate  AI Search
    • AI Recommendations
      • Amazon Personalize  AI Recommendations
      • Recombee  AI Recommendations
    • AI Personalized Search & Recommendations
      • Algolia  AI Personalized Search & Recommendations
      • Google AI Commerce  AI Personalized Search & Recommendations
  • Learn
    • Documentation & Guides – Everything to get started fast
    • Youtube – 100 practical videos from setup to live site demos
    • Forums – Direct support from our team
  • Pricing
  • My licenses
  • Meet
  • 📞  Call
    • 📞  US : (951) 612-8259
    • 📞  France : 01 62 04 55 85
Expand All Collapse All
  • What is WPSOLR ?
    • The standard WordPress SQL search
    • The WPSOLR search with Elasticsearch, Apache Solr, or Algolia
  • Your configuration journey, step by step
    • Install Apache Solr
    • Hosted Apache Solr and SolrCloud Services
    • Install Weaviate
    • Install Opensearch
    • Install Elasticsearch
    • Elasticsearch Hosting
    • Configure search
      • Getting started with search
      • Getting started with Ajax (live) search
      • Getting started with facets
      • 0. Connect your indexes
        • Create a Google Retail search index
        • Create an Elasticsearch index
          • Generate a test Elasticsearch index
          • Create an Elastic Elasticsearch index
          • Create an Elasticsearch index
          • Create a Qbox Elasticsearch index
          • Create an ElasticPress Elasticsearch index
          • Create an Aiven Elasticsearch or OpenSearch index
          • Create a Bonsai Elasticsearch index
          • Create an Amazon AWS Elasticsearch index
          • Create an ObjectRocket Elasticsearch index
          • Create a Cloudways Elasticsearch or Opensearch index
          • Create an Alibaba Cloud Elasticsearch index
          • Create a Compose Elasticsearch index
          • Connect to an Elasticsearch index
        • Create an Apache Solr index
          • Generate a test Apache Solr index
          • Create an Apache Solr index
          • Create a SearchStax SolrCloud index
          • Create an Opensolr Solr index
          • Connect to an Apache Solr index
        • Create an Opensearch index
          • Create a WPSOLR Hosting OpenSearch index
          • Create an Amazon AWS OpenSearch index
        • Create a Weaviate index
          • Weaviate with Google PaLM API
          • Weaviate with GPT4All
          • Weaviate with sentence transformers
          • Weaviate with CLIP text-to-image
          • Weaviate with HuggingFace Endpoints API
          • Weaviate with OpenAI GPT API
          • Weaviate with Cohere Multilingual API
          • Weaviate with Question Answering transformers
          • Weaviate with Hybrid search
          • Weaviate with Reranker - Cohere
          • Weaviate with Reranker - Transformers (cross-encoders)
        • Create an Algolia index
      • 1. Activate extensions (Add-ons)
        • bbPress add-on
        • YITH WooCommerce Ajax Search add-on
        • SEO add-ons
          • Yoast SEO add-on
          • All in One SEO add-on
        • Listable add-on
        • ACF add-on
        • Advanced Scoring add-on
        • Cron Scheduling add-on
        • Theme add-on
          • Filters layouts
            • Radiobox & Checkbox Layout
            • Numeric Range Layout
            • Colour Picker Layout
            • Date Picker (Flatpickr) Layout
            • Range Slider Layout
          • Add Ajax to the current Theme
          • Collapse taxonomy hierarchies
          • Custom Facets CSS
        • WPML add-on
        • Premium add-on
          • Manage more than one Elasticsearch or Solr index
        • PDF Embedder add-on
        • Geolocation add-on
        • AI Natural Language APIs add-on
          • Amazon Comprehend
          • Google Natural Language
          • Aylien Text Analysis
          • MeaningCloud
          • Qwam Text Analytics
        • Toolset Types add-on
        • AI Image and OCR APIs add-on
          • Google Vision
          • Amazon Rekognition
        • Embed Any Document add-on
        • MyListing add-on
        • Polylang add-on
        • WooCommerce add-on
        • Cross-domain federated search add-on
        • Directory+ add-on
        • Toolset Views add-on
        • Listify add-on
        • Jobify add-on
        • Query Monitor add-on
      • 2. Define your search
        • 2.3 Boosts
        • 2.3 Suggestions (Ajax search)
        • 2.1 Search
        • 2.2 Data
      • 3. Index your data
    • Configure recommendations
      • Algolia - Recommend and Personalized search
      • Recombee - Recommendations
      • Google Retail - AI Recommendations and Personalized search
      • Amazon Personalize
    • Configure WPSOLR Parsing and Chunking
    • Create your Custom Templates for Citations, Suggestions, Related Posts & Recommendations
  • Quick start

Date Picker (Flatpickr) Layout

893 views 1 December 5, 2023 Updated on December 13, 2023

Facets layouts: Date picker

The date picker facet is a pretty and easy range selector to filter any post-type that contains a date field that appears between two user selected dates. It is powered by the Flatpickr js library and is highly configurable.

A date picker facet is very useful for blog websites to allow the users to read the posts they need. If they need the oldest, most recents or posts between a random range, this facet will do.

The WPSOLR date picker facet only works with dates.

 

Table of Contents

Toggle
  • Create the View (from the “Views” add-on)
  • Activate the Theme add-on
  • Select the data to index and use for filtering
  • Configure your date picker facet
  • Choose a skin
  • Configure Flatpickr yourself (javascript options)
  • Localization

Create the View (from the “Views” add-on)

 

Each individual view is a WPSOLR configuration. “Views” is a powerfull add-on that allows the webmaster to use different engines and indexes with different configurations at different places in your website.

Create views from the “1. Activate extensions” tab of the WPSOLR dashboard. The view created for this guide has been named “Elastic” but can be named however you want.

In the "1. Activation extensions" tab of the WPSOLR dashboard, select the "Theme" extension. Check the "Use the extension" checkbox to activate the plugin. Click "Add a view" to create a view, you can name it however you want, but for this guide it will be called "Elastic". Do not check the "Disabled" checkbox.

To select the index used for this view, head to the “2. Define your search” tab of the WPSOLR dashboard then to the “2.1 Search”. Be sure to select the correct view (in this case “Elastic“) and select the index of your choosing (in this case “Elastic – Dev – Facets“). To create or connect to an existing index, check out our documentation for Apache Solr, ElasticSearch, Weaviate, Algolia.

Check the boxes in “Replace front-end archives” to display the facets wherever you want.

In the “2. Define your search” tab then the “2.1 Search” tab of the WPSOLR dashboard, select your index from the drop-down list. Beneath it, check the boxes where you would want your facets to appear and filter.

 

Activate the Theme add-on

 

Date picker are part of the  “Theme” add-on. You need to activate it, to be able to select and configure the Date picker facets.

Activate the "Theme" add-on in the "1. Activate extensions" tab of the WPSOLR dashboard

 

Select the data to index and use for filtering

Be sure to select the correct index.  Select the post-types to index. This means that when filtering using the facets, only posts of the following post-types will be returned.

In the "2.2 Data" tab and under "Select data catalog to index", check the checkboxes of the post-types you want to filter.

If you want to use other date fields to filter than default ones like “displaydate_dt“, you have to select the field and the indicate the correct (date) type.

In the "2.2 Data" tab and in each one of the post-types you selected, select "Date, sortable" in"Field type" for all the fields you want.

In the “2.4 Facets” tab, select the facets you want to display. In this case, I chose “displaydate_dt” but if you have any other field of types date you can choose them. Just set them up as Date type like explained above.

Then you can save. After the page refresh, more facet options will appear for each one of the elements you selected.

In the "2.4 Facets" tab, click on the + symbol of any field to choose them as a facet. If you intend on removing a facet click on the - symbol. Click on the "Save Options" button afterwards.

 

Configure your date picker facet

 

In the same tab, for each one of the facets, select the label you want : in this case “Publish date“. This text will appear above the facet in the frontend.

Then you can select the facet layout from a drop-down list : select “Date picker – Flatpickr js library“.

The advanced options of each one of the fields appeared after the "2.4 Facets" page refresh. Set the "Label". Select "Date Picker - Flatpickr js library" from the dropdown list of the layout "Section".

You can then place the facets wherever you want. You can head to “Appearance>Widgets” in the WordPress dashboard. Simply add your “WPSOLR Facets” widget to the one of the sections (Main sidebar, Header, Footer, etc…). This step of the guide largely depends on the theme or plugins you use.

In the WordPress dashboard "Appearance>Widgets", add the "WPSOLR Facets" widget to the section you want. In this case "Main sidebar".

You can then check the filter out in your page. When closed it will appear like this. There is no filter active for now. All of the indexed posts have been published between 2023-11-09 and 2023-12-03.

The datepicker facet is visible in the sidebar of the blog page and not opened. In it is written a range of dates. It is the range of all the published posts publish dates.

When clicking on it, a calendar will appear. You can then select a range and all the elements that will be returned were published between the two dates.

The datepicker has been clicked on and is now open. We can see that the flatpickr window appeared and the user can select a range in the calendar.

As you can see the elements returned are different from before the filtering.

The posts have now been filtered. A different set of posts now appear and the range displayed in the facet is different.

 

Choose a skin

 

Flatpickr has 9 skins to choose from  : Default, Light, Dark, Material Blue, Material Green, Material Red, Material Orange, AirBnB and Confetti.

Select which skin you want from the dropdown list. In this case I chose “Dark“.

In the advanced options section of your date facet (in 2.4 Facets), select the skin you want from the dropdown list in the "Skin" section.

If you go back to the blog page, you can click on the facet to see the calendar with the new skin appear.

If you now check out the page containing the facet and click on it, you can see that the skin has changed.

 

Configure Flatpickr yourself (javascript options)

 

WPSOLR allows you to configure Flatpickr yourself easily by letting you pass on your own Flatpickr config options. You have to add the “wpsolr_flatpickr_date_picker_options”

variable with your own options in the “Javascript options” text field.

For example, to add time to the datepicker, write in the “Javascript options” text field :

wpsolr_flatpickr_date_picker_options = {
    enableTime: true,
    dateFormat: "Y-m-d H:i",
}

In the advanced options of the facet, added "wpsolr_flatpickr_date_picker_options = { enableTime: true, dateFormat: "Y-m-d H:i", }" in the "Javascript options" text field.

The time now appears in the date picker facet.

In the blog page, in Flatpickr, time now appears you can read it in the range and select the time in the bottom of the calendar

 

Localization

 

Date picker works in a wide variety of languages (60+). You can select the language you want in the drop-down list in the “Script” field. In this case I chose fr (French).

The date range facet's advanced options is displayed. The "Script" chosen in the dropdown list is "fr" (French). The "Javascript Options" text field value is "wpsolr_flatpickr_date_picker_options = { locale : "fr",}"

Warning !

For it to work, you need to enable the language, by adding the config option in the “Javascript options” text field. For french, it will be :

wpsolr_flatpickr_date_picker_options = { 
locale : "fr",
}

For every other language, you can replace the “fr” with any other language code that appears in the drop-down list.

 

You can now see that the calendar displays all it’s text in french.

This image shows the date picker facet in the blog page. All the text inside the Flatpickr calendar appears in French.

Was this helpful?

1 Yes  No
Related Articles
  • Configure WPSOLR Parsing and Chunking
  • Create a WPSOLR Hosting OpenSearch index
  • Create your Custom Templates for Citations, Suggestions, Related Posts & Recommendations
  • Getting started with facets
  • Getting started with Ajax (live) search
  • Getting started with search

Didn't find your answer? Contact Us

Previously
Colour Picker Layout
Up Next
Range Slider Layout

Recommended content

Powered by WPSOLR Enterprise with Recombee

Understand Where Your Store Is Losing Sales
Join our Affiliate Program!
Features
Search Hosting for WordPress
File Parsing and Chunking
Integration Hub
Search
Facets (Filters)
Search Add-ons
Recommendations
Keyword search engines
Comparison grid
Apache Solr & Solr Cloud
Elasticsearch
OpenSearch
Algolia
AI search engines
Comparison grid
PostgreSQL pgvector
Weaviate
Google Retail
Vespa.ai
OpenSearch vector
AI recommendation engines
Comparison grid
Recombee
Amazon Personalize
AI personalization engines
Comparison grid
Google Retail
Algolia
Buy and Learn
Pricing
Privacy policy
Terms and Conditions
© 2026 Eostis SARL. All Rights Reserved.
More
My licenses
Support
Documentation
Blog
Recommendations powered for you by WPSolr
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}