{"id":21004603,"url":"https://github.com/rangerrick/moment-javaformat","last_synced_at":"2025-05-15T01:33:08.797Z","repository":{"id":37206634,"uuid":"235596279","full_name":"RangerRick/moment-javaformat","owner":"RangerRick","description":"Format Moment.js objects using Java date formatter strings","archived":false,"fork":false,"pushed_at":"2024-11-11T18:52:27.000Z","size":14795,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-11-11T19:39:02.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RangerRick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-22T14:55:53.000Z","updated_at":"2024-11-11T18:50:22.000Z","dependencies_parsed_at":"2023-10-17T01:38:56.909Z","dependency_job_id":"e1b28bb0-e640-4d49-a43f-ac0069c4eaf2","html_url":"https://github.com/RangerRick/moment-javaformat","commit_stats":{"total_commits":1146,"total_committers":4,"mean_commits":286.5,"dds":0.5078534031413613,"last_synced_commit":"7f88cf31395d3c34500568238fc63b821b6c1471"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerRick%2Fmoment-javaformat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerRick%2Fmoment-javaformat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerRick%2Fmoment-javaformat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerRick%2Fmoment-javaformat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RangerRick","download_url":"https://codeload.github.com/RangerRick/moment-javaformat/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225320932,"owners_count":17456102,"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":[],"created_at":"2024-11-19T08:36:54.386Z","updated_at":"2024-11-19T08:36:55.049Z","avatar_url":"https://github.com/RangerRick.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# moment-javaformat\n\n[![CircleCI](https://circleci.com/gh/RangerRick/moment-javaformat/tree/main.svg?style=svg)](https://circleci.com/gh/RangerRick/moment-javaformat/tree/main)\n\nThis plugin for [Moment.js](https://momentjs.com/) adds support for formatting using the Java [SimpleDateFormat](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) and [DateTimeFormatter](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html) format options.\n\nIt differs from [moment-jdateformatparser](https://github.com/MadMG/moment-jdateformatparser) in that it doesn't just try to translate Java format strings to Moment, but instead implements a new set of format methods that can handle a wider range of Java format strings, at the expense of speed.\n\nThanks to [moment-jdateformatparser](https://github.com/MadMG/moment-jdateformatparser) for the basic idea, I ran with it in my own way because we needed some formats that just plain aren't possible in a simple format string translation. :)\n\n## Version History\n\nChanges made in the `develop` branch are checked against unit tests upon commit.\nThe latest [CHANGELOG.md](https://github.com/RangerRick/moment-javaformat/blob/main/CHANGELOG.md) is then auto-generated from the commit history and merged to `main`.\n\n## Requirements\n\nThis plugin requires loading either `moment` or `moment-timezone`, but some functionality will be undefined or fail if you are using Moment.js without timezone support.\n\n## Usage\n\nIn most cases, all you should have to do is load this module after you load moment, and then new methods are available to you for formatting:\n\n```javascript\nconst moment = require(\"moment-timezone\");\nrequire(\"@rangerrick/moment-javaformat\");\n\nlet now = moment(\"2020-01-01T15:00:00Z\");\n// a format matching Java 8 SimpleDateFormat definitions\nnow.formatJavaSDF(\"yyyy-MM-dd HH:mm\"); // 2020-01-01 15:00\n\n// a format matching Java 8 DateTimeFormatter definitions\nnow.formatJavaDTF(\"yyyy-MM-dd HH:mm:ss O\"); // 2020-01-01 15:00:00 GMT-05:00\n```\n\n## Installation\n\nYou can install `moment-javaformat` from npm in the usual ways:\n\n```shell\n# install using npm\nnpm install --save @rangerrick/moment-javaformat\n\n# install using yarn\nyarn add @rangerrick/moment-javaformat\n```\n\n## Caveats\n\nA few format strings are difficult to implement without going deeper down the rabbit hole than I was willing to go. ;)\n\n- SimpleDateFormat: `W` (week-of-month), `F` (day-of-week-in-month)\n- DateTimeFormatter: `W` (week-of-month), `F` (day-of-week-in-month), `n` (nano-of-second), `N` (nano-of-day)\n\nI might implement the nano ones if I get around to doing the math (and probing `window.performance.now()`) but Date objects don't have that level of accuracy anyway.\n\n## License\n\n`moment-javaformat` is freely distributable under the terms of the MIT license.\n\nCopyright (c) 2020-2024 Benjamin Reed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frangerrick%2Fmoment-javaformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frangerrick%2Fmoment-javaformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frangerrick%2Fmoment-javaformat/lists"}