Skip to content

Добавлена статья о DateOnly и TimeOnly#231

Open
Nasutya wants to merge 1 commit into
masterfrom
feature-160-dateonly-changes
Open

Добавлена статья о DateOnly и TimeOnly#231
Nasutya wants to merge 1 commit into
masterfrom
feature-160-dateonly-changes

Conversation

@Nasutya

@Nasutya Nasutya commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Добавлена новая документация о поддержке DateOnly и TimeOnly в Flexberry ORM.
    • Описаны преобразования значений, работа с nullable-типами, LINQ/LCS-примеры и особенности для разных СУБД.
  • Documentation

    • Обновлена навигация сайта: добавлена ссылка на новую страницу в разделе типов данных.

@Nasutya Nasutya requested a review from Anisimova2020 June 26, 2026 12:00
@Nasutya Nasutya self-assigned this Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Walkthrough

Добавлены новые англоязычная и русскоязычная страницы документации о поддержке DateOnly и TimeOnly в Flexberry ORM, а также ссылка на материал в sidebar. Страницы описывают преобразование типов, LCS/LINQ, работу с БД, nullable-типы, функциональный язык и пример сущности.

Changes

Документация DateOnly и TimeOnly

Layer / File(s) Summary
Метаданные страницы, вводная часть и sidebar
_data/sidebars/flexberry-orm_sidebar.yml, pages/products/flexberry-orm/data-types/fo_date-only-time-only.*.md
Добавлены frontmatter, вводное описание и ссылка на новый материал в sidebar.
Преобразование и LCS-функции
pages/products/flexberry-orm/data-types/fo_date-only-time-only.*.md
Описаны преобразования значений между DateTime, TimeSpan, строками и DateOnly/TimeOnly, а также LCS-функции для дат и времени.
LINQ и базы данных
pages/products/flexberry-orm/data-types/fo_date-only-time-only.*.md
Документированы поддерживаемые свойства и примеры LINQ-запросов, затем показаны SQL-представления и функции для PostgreSQL, MSSQL и Oracle.
Nullable и примеры сущности
pages/products/flexberry-orm/data-types/fo_date-only-time-only.*.md
Добавлены примеры для DateOnly? и TimeOnly?, маппинг на DateTimeType и условная компиляция в примере сущности.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Я, кролик, прыгнул в дату — хрум!
DateOnly и TimeOnly — мой тёплый дом.
В sidebar нашёл я новый путь,
Где LINQ и LCS умеют блеснуть.
Морковный свет над docs-лугом — прыг да скок!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основное изменение: добавлена статья о DateOnly и TimeOnly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature-160-dateonly-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md (1)

27-27: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Добавьте пустую строку перед блоком кода.

Согласно правилу MD031, fenced code blocks должны окружаться пустыми строками. Перед ```csharp на строке 27 отсутствует пустая строка после текста "Example:" на строке 26.

Аналогичная проблема присутствует на строках 62, 149, 165, 178.

📝 Предлагаемое исправление
 Example:
-
+
 ```csharp
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md` at line
27, The Markdown in fo_date-only-time-only.en.md violates MD031 because fenced
code blocks are placed directly after surrounding text without a separating
blank line. Add an empty line before each affected fenced block so the `
```csharp ` sections are surrounded by blank lines, especially after the
“Example:” text and at the other flagged code block locations in the document.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md`:
- Around line 222-252: The Object definition example is incomplete for
cross-version compilation because the DateOnly/TimeOnly properties in MyEntity
are only declared under NET6_0_OR_GREATER. Update the example to include a
matching `#else` branch with DateTime-based BirthDate, MeetingTime, OptionalDate,
and OptionalTime properties, or simplify the snippet if manual conditional
compilation is not intended, so the MyEntity example stays valid for older
target frameworks too.
- Line 59: The description for funcSSPart is too specific to DateTime and should
be clarified for the DateOnly/TimeOnly context. Update the table entry for
funcSSPart in this documentation so it reflects TimeOnly as well, using wording
like “Seconds from DateTime/TimeOnly” or equivalent, and keep the symbol name
funcSSPart unchanged.

In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.ru.md`:
- Line 12: Fix the spacing typo in the documentation text by adding the missing
space before .NET in the sentence about earlier framework versions; update the
copy in fo_date-only-time-only.ru.md so “более ранних версий.NET” becomes “более
ранних версий .NET”.

---

Nitpick comments:
In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md`:
- Line 27: The Markdown in fo_date-only-time-only.en.md violates MD031 because
fenced code blocks are placed directly after surrounding text without a
separating blank line. Add an empty line before each affected fenced block so
the ` ```csharp ` sections are surrounded by blank lines, especially after the
“Example:” text and at the other flagged code block locations in the document.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: debef5c7-e420-45d8-9d9c-4187a206aa45

📥 Commits

Reviewing files that changed from the base of the PR and between 0747e11 and 396241f.

📒 Files selected for processing (3)
  • _data/sidebars/flexberry-orm_sidebar.yml
  • pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md
  • pages/products/flexberry-orm/data-types/fo_date-only-time-only.ru.md

|---------|----------|------------------|
| `funcDayNumber` | Day number from 0001-01-01 | Numeric |
| `funcDayOfYear` | Day of year (1-366) | Numeric |
| `funcSSPart` | Seconds from DateTime | Numeric |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Уточните описание funcSSPart для контекста TimeOnly.

Описание "Seconds from DateTime" может сбивать с толку на странице, посвящённой DateOnly/TimeOnly. Если функция применима и к TimeOnly, стоит уточнить описание, например: "Seconds from DateTime/TimeOnly".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md` at line
59, The description for funcSSPart is too specific to DateTime and should be
clarified for the DateOnly/TimeOnly context. Update the table entry for
funcSSPart in this documentation so it reflects TimeOnly as well, using wording
like “Seconds from DateTime/TimeOnly” or equivalent, and keep the symbol name
funcSSPart unchanged.

Comment on lines +222 to +252
## Object definition example

```csharp
public class MyEntity : ICSSoft.STORMNET.DataObject
{
#if NET6_0_OR_GREATER
private System.DateOnly fBirthDate;
private System.TimeOnly fMeetingTime;
#else
private System.DateTime fBirthDate;
private System.DateTime fMeetingTime;
#endif

#if NET6_0_OR_GREATER
public virtual System.DateOnly BirthDate
{
get => fBirthDate;
set => fBirthDate = value;
}

public virtual System.TimeOnly MeetingTime
{
get => fMeetingTime;
set => fMeetingTime = value;
}

public virtual System.DateOnly? OptionalDate { get; set; }
public virtual System.TimeOnly? OptionalTime { get; set; }
#endif
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚖️ Poor tradeoff

Пример условной компиляции неполный для кросс-версионной совместимости.

В примере объявления объекта поля имеют ветки #if/#else/#endif для обоих таргетов (строки 227–233), а свойства объявлены только для NET6_0_OR_GREATER (строки 235–250). При компиляции для более ранних версий .NET свойства BirthDate, MeetingTime, OptionalDate, OptionalTime отсутствуют вовсе.

Если цель — показать рекомендуемый паттерн для кода, поддерживающего обе версии, следует добавить #else-ветку со свойствами типа DateTime. Если же ORM прозрачно выполняет замену, и пользователю не требуется ручная условная компиляция, пример стоит упростить.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.en.md` around
lines 222 - 252, The Object definition example is incomplete for cross-version
compilation because the DateOnly/TimeOnly properties in MyEntity are only
declared under NET6_0_OR_GREATER. Update the example to include a matching `#else`
branch with DateTime-based BirthDate, MeetingTime, OptionalDate, and
OptionalTime properties, or simplify the snippet if manual conditional
compilation is not intended, so the MyEntity example stays valid for older
target frameworks too.


## Обзор

Типы `DateOnly` и `TimeOnly` появились в .NET 6.0. Flexberry ORM поддерживает эти типы, при этом при компиляции для более ранних версий.NET используется `DateTime` в качестве замены.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Исправьте орфографию: пропущен пробел.

«более ранних версий.NET» → «более ранних версий .NET»

📝 Исправление
-при компиляции для более ранних версий.NET используется
+при компиляции для более ранних версий .NET используется
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Типы `DateOnly` и `TimeOnly` появились в .NET 6.0. Flexberry ORM поддерживает эти типы, при этом при компиляции для более ранних версий.NET используется `DateTime` в качестве замены.
Типы `DateOnly` и `TimeOnly` появились в .NET 6.0. Flexberry ORM поддерживает эти типы, при этом при компиляции для более ранних версий .NET используется `DateTime` в качестве замены.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/products/flexberry-orm/data-types/fo_date-only-time-only.ru.md` at line
12, Fix the spacing typo in the documentation text by adding the missing space
before .NET in the sentence about earlier framework versions; update the copy in
fo_date-only-time-only.ru.md so “более ранних версий.NET” becomes “более ранних
версий .NET”.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant