{"id":21269931,"url":"https://github.com/prysmex/datemath","last_synced_at":"2026-03-12T11:05:01.680Z","repository":{"id":110449243,"uuid":"504200551","full_name":"prysmex/datemath","owner":"prysmex","description":"Elasticsearch's date parser for Ruby","archived":false,"fork":false,"pushed_at":"2025-03-21T06:54:34.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T07:31:43.982Z","etag":null,"topics":["datemath","elasticsearch","gem","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prysmex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T15:04:12.000Z","updated_at":"2025-03-21T06:54:37.000Z","dependencies_parsed_at":"2023-12-01T23:25:04.845Z","dependency_job_id":"3f78a346-8c38-424c-899a-3c2789dd46f8","html_url":"https://github.com/prysmex/datemath","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prysmex%2Fdatemath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prysmex%2Fdatemath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prysmex%2Fdatemath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prysmex%2Fdatemath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prysmex","download_url":"https://codeload.github.com/prysmex/datemath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868826,"owners_count":21174754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datemath","elasticsearch","gem","ruby"],"created_at":"2024-11-21T08:13:26.667Z","updated_at":"2026-03-12T11:05:01.633Z","avatar_url":"https://github.com/prysmex.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Datemath\n\nElasticsearch's date parser for Ruby\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'datemath'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install datemath\n\n## Usage\n\nDatemath uses Elasticsearch's date parser to handle date expressions. \n\nHere are a few examples: \n\nCurrent date time: \n\n```ruby\nDatemath::Parser.new(\"now\").parse\n```\n\nSpecific date time: \n\n```ruby\nDatemath::Parser.new(\"2015-05-05T00:00:00\").parse\n```\n\nComplex expression: \n\n```ruby\nDatemath::Parser.new(\"now+1d\").parse\n```\n\nMultiple operations: \n\n```ruby\nDatemath::Parser.new(\"now+1d-1m\").parse\n```\n\nRounding: \n\n```ruby\nDatemath::Parser.new(\"now+1d-1m/d\").parse\n```\n\nAnchoring dates:\n\n```ruby\nDatemath::Parser.new(\"2015-05-05T00:00:00||+1d-1m\").parse\n```\n\nYou can see more cases here: [here](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/date-math-expressions.html)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/prysmex/datemath. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Datemath project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/prysmex/datemath/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprysmex%2Fdatemath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprysmex%2Fdatemath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprysmex%2Fdatemath/lists"}