Date and time attributes¶
The date and time attribute type allows you to represent date and time values as part of the product specification in the Product Information Management system.
It's released as an LTS update that you can install on top of your current project to expand the capabilities of your Ibexa DXP, starting with version v4.6.17 and higher.
You can use it to store, for example, manufacturing dates, expiration dates, or event dates, all with specified accuracy.
Installation¶
Download the bundle¶
To get the most recent stable version of this package, open a command terminal, navigate to your project directory, and run the following command:
1 |
|
Enable the bundle¶
Symfony Flex enables and configures the IbexaProductCatalogDateTimeAttributeBundle
automatically.
If you don't use it, you can manually enable this bundle by adding it to the list of bundles in config/bundles.php
:
1 2 3 4 5 |
|
Update database schema¶
The new attribute type requires changes to the database schema. Execute the following queries on your database to support the new attribute type:
1 2 |
|
1 2 3 4 |
|
You can now start working with the date and time attribute type.
Usage¶
The date and time attribute type's support in the system is on par with the other, built-in attribute types.
You can manage it through the back office, data migrations, REST, or through the PHP API. It also supports searching by using DateTimeAttribute and DateTimeAttributeRange criterions.
When creating an attribute based on the date and time attribute type you can select the accuracy level to match your needs:
Accuracy | Example | Limitations |
---|---|---|
Year | 2025 | Number between 1000 and 9999 |
Trimester | Q3 2025 | |
Month | July 2025 | |
Day | 2025-07-06 | |
Minute | 2025-07-06 11:15 | |
Second | 2025-07-06 11:15:37 |