{"id":16225916,"url":"https://github.com/bestguy/knockout-filter-date","last_synced_at":"2025-10-08T22:26:45.117Z","repository":{"id":18342942,"uuid":"21522619","full_name":"bestguy/knockout-filter-date","owner":"bestguy","description":"Knockout 3 handlebars filter for date formatting","archived":false,"fork":false,"pushed_at":"2014-07-09T05:29:41.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T02:51:21.683Z","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/bestguy.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":null,"support":null}},"created_at":"2014-07-05T15:26:48.000Z","updated_at":"2014-07-05T15:34:52.000Z","dependencies_parsed_at":"2022-08-25T12:10:54.256Z","dependency_job_id":null,"html_url":"https://github.com/bestguy/knockout-filter-date","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fknockout-filter-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fknockout-filter-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fknockout-filter-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fknockout-filter-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestguy","download_url":"https://codeload.github.com/bestguy/knockout-filter-date/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773744,"owners_count":20993633,"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-10T12:46:55.145Z","updated_at":"2025-10-08T22:26:40.061Z","avatar_url":"https://github.com/bestguy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knockout 3 handlebars filter for date formatting\n\nAllow handlebars-style filtering for formatting dates using Moment.js:\n\n    \u003ch1\u003e\n      Here is some date: {{ someDate | date: 'MM/dd/YYYY' }}\n    \u003c/h1\u003e\n    \u003ctime datetime=\"{{ someDate | 'YYYY-MM' }}\"\u003eHere is an attribute\u003c/time\u003e\n\n## Dependencies:\n\n- **Knockout 3+** - [http://knockoutjs.com](http://knockoutjs.com)\n- **Knockout.Punches** - [http://mbest.github.io/knockout.punches/](http://mbest.github.io/knockout.punches/)\n- **Moment.js** - [http://momentjs.com/](http://momentjs.com/)\n\n----\n\n## Usage:\n\nIn order to use this filter, you need to include the above libraries via one of these options:\n\n### [requirejs](http://requirejs.org/)\n\n(Names and paths below can be whatever you prefer):\n\n    requirejs.config({\n      paths: {\n        'knockout': '../lib/knockout/knockout-3.1.0',\n        'knockout.date': '../lib/knockout/knockout.punches',\n        'knockout.punches': '../lib/knockout/knockout.punches',\n        'moment': '../lib/moment/moment',\n        ...\n      }\n    });\n    define(['knockout', 'knockout.punches', 'knockout.date'], function (ko, punches, date_filter) {\n      ...\n\n### Script tags (uses globals)\n\n    \u003cscript src=\"/scripts/lib/knockout-3.1.0.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/scripts/lib/knockout.punches.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/scripts/lib/moment.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/scripts/lib/date_filter.js\"\u003e\u003c/script\u003e\n\n\nIn either case, you to enable handlebars processing via Knockout.Punches:\n\n    ko.punches.enableAll();\n    ko.punches.attributeInterpolationMarkup.enable();\n\n\nThen in your view, you can display a formatted date in text or attributes \n\n    {{ yourDate | date: 'dateFormat' }}\n\nWhere `yourDate` is a property in your view containing any of the following:\n\n* Date value\n* String value _(see [http://momentjs.com/docs/#/parsing/string/](http://momentjs.com/docs/#/parsing/string/))_\n* A ko.observable containing a Date or string value. \n\n`dateFormat` is a string can be anything that moment.js supports: [http://momentjs.com/docs/#/displaying/](http://momentjs.com/docs/#/displaying/)\n\nNote, instead of embedding in filter, it can also be a property in your view model, e.g.:\n\n    {{ yourDate | date: yourFormat }}\n\n\n## Testing (this repo)\n\n- [Install Grunt](http://gruntjs.com/getting-started#installing-the-cli)\n- From this code's directory, run `grunt` or `grunt verify`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestguy%2Fknockout-filter-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestguy%2Fknockout-filter-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestguy%2Fknockout-filter-date/lists"}