Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T torque-postgresql
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Carlos
  • torque-postgresql
  • Wiki
  • Interval

Interval · Changes

Page history
Updated Interval (markdown) authored Apr 20, 2017 by Carlos's avatar Carlos
Hide whitespace changes
Inline Side-by-side
Interval.md
View page @ 1bdd7e05
......@@ -35,4 +35,10 @@ course.duration = 'P1Y2M3DT4H5M6S' # It accepts ISO 8601 format, so form f
course.duration = 259200
course.duration.parts.to_h == {days: 3} # It also converts any set value to the correct separated duration
```
On your views, you can use `I18n.locale` to transform it to a readable text:
```html
<p>Course duration: <%= l @course.duration %></p>
<!-- Will print something like 'Course duration: 1 year, 2 months, and 3 days' -->
```
\ No newline at end of file
Clone repository
  • Wiki
  • Configuring

Data types

  • Enum
  • Interval

Querying

  • Distinct On
  • Auxiliary Statements