Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added information about Date and Time attribute #2609

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Feb 11, 2025

Adds information about the latest LTS update: Date and time attribute.

Target: master, 4.6

The PR can be reviewed already, but the following things still need to be added:

Changes:

@mnocon mnocon changed the title Added informtion about Date and Time attribute Added information about Date and Time attribute Feb 11, 2025
@ibexa ibexa deleted a comment from github-actions bot Feb 11, 2025
@mnocon mnocon marked this pull request as ready for review February 12, 2025 08:13
Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php


code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php

docs/search/criteria_reference/datetimeattribute_criterion.md@20:``` php
docs/search/criteria_reference/datetimeattribute_criterion.md@21:[[= include_file('code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php') =]]
docs/search/criteria_reference/datetimeattribute_criterion.md@22:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶use DateTimeImmutable;
004⫶use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion;
005⫶use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
006⫶use Ibexa\Contracts\ProductCatalogDateTimeAttribute\Search\Criterion\DateTimeAttribute;
007⫶
008⫶$query = new ProductQuery();
009⫶$filter = new DateTimeAttribute('event_date', new DateTimeImmutable('2025-07-06'));
010⫶$filter->setOperator(FieldValueCriterion::COMPARISON_EQ);
011⫶$query->setFilter($filter);
012⫶/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
013⫶$results = $productService->findProducts($query);


code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php


code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php

docs/search/criteria_reference/datetimeattributerange_criterion.md@22:``` php
docs/search/criteria_reference/datetimeattributerange_criterion.md@23:[[= include_file('code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php') =]]
docs/search/criteria_reference/datetimeattributerange_criterion.md@24:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶use DateTimeImmutable;
004⫶use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
005⫶use Ibexa\Contracts\ProductCatalogDateTimeAttribute\Search\Criterion\DateTimeAttributeRange;
006⫶
007⫶$query = new ProductQuery();
008⫶$query->setFilter(new DateTimeAttributeRange('event_date', new DateTimeImmutable('2025-01-01')));
009⫶/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
010⫶$results = $productService->findProducts($query);


code_samples/data_migration/examples/create_datetime_attribute.yaml


code_samples/data_migration/examples/create_datetime_attribute.yaml

docs/content_management/data_migration/importing_data.md@353:``` yaml
docs/content_management/data_migration/importing_data.md@354:[[= include_file('code_samples/data_migration/examples/create_datetime_attribute.yaml') =]]
docs/content_management/data_migration/importing_data.md@355:```

001⫶- type: attribute
002⫶ mode: create
003⫶ identifier: event_date
004⫶ attribute_group_identifier: example
005⫶ attribute_type_identifier: datetime
006⫶ position: 1
007⫶ names:
008⫶ eng-GB: 'Event date'
009⫶ options:
010⫶ accuracy: day # One of: second, minute, day, month, trimester, year

Download colorized diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant