Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.87 KB

DateService.md

File metadata and controls

58 lines (41 loc) · 1.87 KB

Meritoo Common Bundle

Common & useful classes, resources, extensions. Based on Symfony framework.

DateService

Located here: Meritoo\CommonBundle\Service\DateService. Serves dates.

Parameters from configuration

Uses parameters:

  • date.format.date: d.m.Y (default value)
  • date.format.datetime: d.m.Y H:i (default value)
  • date.format.time: H:i (default value)

Methods

getDateFormat()

Returns format of date according to given length of date. There are 3 lengths of date:

  • date - Meritoo\CommonBundle\Type\Date\DateLength::DATE constant
  • datetime - Meritoo\CommonBundle\Type\Date\DateLength::DATETIME constant
  • time - Meritoo\CommonBundle\Type\Date\DateLength::TIME constant

Format of date is based on those lengths of date that are stored in application's configuration in these parameters:

  • date.format.date
  • date.format.datetime
  • date.format.time
getDateFormatted()

Returns date formatted according to given length of date. Format of date is provided by getDateFormat() method ( described above).

More

  1. Configuration
  2. Dependency Injection Extension
  3. Descriptor of application
  4. Descriptor of bundle
  5. Descriptors of bundles
  6. Services:
  7. Tests
  8. Translations
  9. Twig extensions:

‹ Back to Readme