{"id":19574333,"url":"https://github.com/straticjs/stratic-handle-offset","last_synced_at":"2026-06-17T07:32:31.616Z","repository":{"id":57371892,"uuid":"104684704","full_name":"straticjs/stratic-handle-offset","owner":"straticjs","description":"Return a properly configured MomentJS moment for a Stratic post","archived":false,"fork":false,"pushed_at":"2020-06-01T01:02:31.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T14:19:22.870Z","etag":null,"topics":["hacktoberfest","javascript","plumbing","stratic"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/straticjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-24T23:55:26.000Z","updated_at":"2021-10-07T16:59:04.000Z","dependencies_parsed_at":"2022-09-26T16:41:12.639Z","dependency_job_id":null,"html_url":"https://github.com/straticjs/stratic-handle-offset","commit_stats":null,"previous_names":["strugee/stratic-handle-offset"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/straticjs/stratic-handle-offset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-handle-offset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-handle-offset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-handle-offset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-handle-offset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/straticjs","download_url":"https://codeload.github.com/straticjs/stratic-handle-offset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-handle-offset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34439296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest","javascript","plumbing","stratic"],"created_at":"2024-11-11T06:40:00.159Z","updated_at":"2026-06-17T07:32:31.598Z","avatar_url":"https://github.com/straticjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `stratic-handle-offset`\n\n[![Build Status](https://travis-ci.org/straticjs/stratic-handle-offset.svg?branch=master)](https://travis-ci.org/straticjs/stratic-handle-offset)\n[![Coverage Status](https://coveralls.io/repos/github/straticjs/stratic-handle-offset/badge.svg?branch=master)](https://coveralls.io/github/straticjs/stratic-handle-offset?branch=master)\n[![Greenkeeper badge](https://badges.greenkeeper.io/straticjs/stratic-handle-offset.svg)](https://greenkeeper.io/)\n\nReturn a properly configured [MomentJS][1] moment for a Stratic post\n\n## Installation\n\n    npm install stratic-handle-offset\n\n## Usage\n\nAll this does is make sure that UTC offset information in Stratic posts is handled properly. This is pretty simple but is easy to forget to do (or to forget the details of how to do) - hence this module.\n\nThe module exports a single function. In order to use it, just pass the function the Stratic post's time information object (almost always `file.data.time`). You will get back a [MomentJS][1] moment with the offset information all set up so that when you call `moment#month()`, `moment#year()`, etc., everything Just Works™ and you get back accurate information.\n\n## Example\n\n```js\nvar handleOffset = require('stratic-handle-offset');\nvar through2 = require('through2');\n\nthrough2.obj(function(file, enc, callback) {\n\tvar date = handleOffset(file.data.time);\n\t// `date` is now a MomentJS moment; do with that what you will\n\t// E.g.:\n\n\tvar year = date.year();\n}\n```\n\n## Code of Conduct\n\nPlease note that StraticJS is developed under the [Contributor Covenant][2] Code of Conduct. Project contributors are expected to respect these terms.\n\nFor the full Code of Conduct, see [CODE_OF_CONDUCT.md][3]. Violations may be reported to \u003calex@strugee.net\u003e.\n\n## License\n\nLGPL 3.0+\n\n## Author\n\nAJ Jordan \u003calex@strugee.net\u003e\n\n [1]: http://momentjs.com/\n [2]: http://contributor-covenant.org/\n [3]: https://github.com/straticjs/stratic-handle-offset/blob/master/CODE_OF_CONDUCT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraticjs%2Fstratic-handle-offset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstraticjs%2Fstratic-handle-offset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraticjs%2Fstratic-handle-offset/lists"}