vbudkodev/russian-date-grammatical-helper

PHP helper for Russian date components with grammatical cases support

Maintainers

Package info

github.com/vbudkodev/russian-date-grammatical-helper

pkg:composer/vbudkodev/russian-date-grammatical-helper

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-10-17 10:54 UTC

This package is auto-updated.

Last update: 2026-03-17 11:37:13 UTC


README

PHP Version License

A lightweight PHP library for working with Russian date components with full grammatical cases support. Perfect for generating grammatically correct date phrases in Russian.

Installation

composer require vbudkodev/russian-date-grammatical-helper

Current Features

Month Names with Grammatical Cases

use RussianDateGrammaticalHelper\MonthHelper;
use RussianDateGrammaticalHelper\GrammaticalCase;

// Basic usage
echo MonthHelper::name(1); // 'январь' (nominative)

// Specific cases
echo MonthHelper::name(1, GrammaticalCase::GENITIVE); // 'января'
echo MonthHelper::name(1, GrammaticalCase::PREPOSITIONAL); // 'январе'

// Prepositional phrase
echo MonthHelper::in(5); // 'в мае'

// All forms at once
$forms = MonthHelper::forms(3);
echo $forms[GrammaticalCase::NOMINATIVE->value]; // 'март'
echo $forms[GrammaticalCase::GENITIVE->value]; // 'марта'

Available Cases

All six Russian grammatical cases are supported via the Case enum:

  • GrammaticalCase::NOMINATIVE - Именительный (кто? что?)
  • GrammaticalCase::GENITIVE - Родительный (кого? чего?)
  • GrammaticalCase::DATIVE - Дательный (кому? чему?)
  • GrammaticalCase::ACCUSATIVE - Винительный (кого? что?)
  • GrammaticalCase::INSTRUMENTAL - Творительный (кем? чем?)
  • GrammaticalCase::PREPOSITIONAL - Предложный (о ком? о чём?)

Roadmap

  • Day of week names with cases
  • Year formatting (e.g., "в 2026 году")
  • Full date formatting helpers
  • Seasonal and relative date phrases

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.