{"id":15456053,"url":"https://github.com/gr2m/moment-parseformat","last_synced_at":"2025-12-12T04:32:30.179Z","repository":{"id":13925711,"uuid":"16625175","full_name":"gr2m/moment-parseformat","owner":"gr2m","description":"A moment.js plugin to extract the format of a date/time string","archived":false,"fork":false,"pushed_at":"2022-09-23T19:40:25.000Z","size":1381,"stargazers_count":45,"open_issues_count":14,"forks_count":30,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-22T13:24:06.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://gr2m.github.io/moment-parseformat","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-07T19:34:34.000Z","updated_at":"2024-03-21T18:27:31.000Z","dependencies_parsed_at":"2022-08-31T00:31:00.872Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/moment-parseformat","commit_stats":null,"previous_names":["gr2m/moment.parseformat"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fmoment-parseformat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fmoment-parseformat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fmoment-parseformat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fmoment-parseformat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/moment-parseformat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246679067,"owners_count":20816402,"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-10-01T22:22:16.353Z","updated_at":"2025-12-12T04:32:28.136Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"moment.parseFormat – a moment.js plugin\n=======================================\n\n[![Test](https://github.com/gr2m/moment-parseformat/actions/workflows/test.yml/badge.svg)](https://github.com/gr2m/moment-parseformat/actions/workflows/test.yml)\n\n\u003e A moment.js plugin to extract the format of a date/time string\n\nInstallation\n------------\n\nLoad via script tag\n\n```html\n\u003cscript src=\"moment.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"moment.parseFormat.js\"\u003e\u003c/script\u003e\n```\n\nInstall using [npm](https://npmjs.org/) for node.js:\n\n```\nnpm install --save moment-parseformat\n```\n\n\nBrowser Usage\n-----\n\n```js\nvar format = moment.parseFormat('Thursday, February 6th, 2014 9:20pm'/* , options */);\n// dddd, MMMM Do, YYYY h:mma\nmoment().format(format); // format\n```\n\n\nNode / CommonJS Usage\n-----\n```js\nvar moment  = require 'moment'\nvar parseFormat = require('moment-parseformat')\n\nvar format = parseFormat('Thursday, February 6th, 2014 9:20pm'/* , options */);\n// dddd, MMMM Do, YYYY h:mma\nmoment().format(format); // format\n```\n\n\nOptions\n----\n\nOptions can be passed as 2nd parameter\n\n\n#### preferredOrder\nType: `Object` or `String`\n\n`parseFormat` tries to figure out the the order of day/month/year by itself\nif it finds 3 numbers separated by `.`, `-` or `/`. But if it can't, it will fallback\nto `preferredOrder`, which can either be set as an object to differentiate by separator,\nor as a simple string.\n\nDefault value:\n\n```js\npreferredOrder: {\n  '/': 'MDY',\n  '.': 'DMY',\n  '-': 'YMD'\n}\n```\n\nUsage\n\n```js\nparseFormat('10.10.2010', {preferredOrder: 'DMY'});\n// ☛ DD.MM.YYYY\nparseFormat('10.10.2010', {preferredOrder: 'MDY'});\n// ☛ MM.DD.YYYY\nparseFormat('10.10.2010', {preferredOrder: {\n  '/': 'MDY',\n  '.': 'DMY',\n  '-': 'YMD'\n}});\n// ☛ MM.DD.YYYY\nparseFormat('10/10/2010', {preferredOrder: {\n  '/': 'MDY',\n  '.': 'DMY',\n  '-': 'YMD'\n}});\n// ☛ DD/MM/YYYY\n```\n\n\nFine Print\n----------\n\nThe moment.parseFormat Plugin have been authored by [Gregor Martynus](https://github.com/gr2m),\nproud member of the [Hoodie Community](http://hood.ie/).\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fmoment-parseformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Fmoment-parseformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fmoment-parseformat/lists"}