{"id":16288665,"url":"https://github.com/matronator/timedecimal","last_synced_at":"2025-04-09T07:15:10.646Z","repository":{"id":107364544,"uuid":"244076137","full_name":"matronator/TimeDecimal","owner":"matronator","description":"Convert time to decimal","archived":false,"fork":false,"pushed_at":"2021-02-02T09:28:27.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T13:18:16.860Z","etag":null,"topics":["conversion","converter","time","time-calculator","time-conversion","time-converter","unit-conversion","utility","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"https://matronator.github.io/TimeDecimal/","language":"JavaScript","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/matronator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2020-03-01T02:51:47.000Z","updated_at":"2021-02-02T09:28:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff95233c-fb1e-48ae-b3b7-a7cf371e3a12","html_url":"https://github.com/matronator/TimeDecimal","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.2777777777777778,"last_synced_commit":"37bfd0775d35d89b8633fa4a62ab05bf3d7d4595"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matronator%2FTimeDecimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matronator%2FTimeDecimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matronator%2FTimeDecimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matronator%2FTimeDecimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matronator","download_url":"https://codeload.github.com/matronator/TimeDecimal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994123,"owners_count":21030048,"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":["conversion","converter","time","time-calculator","time-conversion","time-converter","unit-conversion","utility","vanilla-javascript","vanilla-js"],"created_at":"2024-10-10T19:49:02.609Z","updated_at":"2025-04-09T07:15:10.619Z","avatar_url":"https://github.com/matronator.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimeDecimal\n\nConvert formatted time (HH:MM:SS) to decimal values\n\nhttps://matronator.github.io/TimeDecimal/\n\n## Instalation\n\n### NPM\n\nhttps://www.npmjs.com/package/time-decimal\n\n```\nnpm i time-decimal\n```\n\n### Browser\n\nDownload `time-decimal.js` or `time-decimal.min.js` from `dist` folder and include in your html file\n\n```html\n\u003cscript src=\"path/to/folder/time-decimal.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript src=\"path/to/folder/time-decimal.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### NPM\n\n```javascript\nimport * as tdec from \"time-decimal\";\n\n// How many hours/minutes/seconds is 11:45:30\n\nlet hours = 11;\nlet minutes = 45;\nlet seconds = 30;\n\n// hours - if minutes and seconds are not provided, their default value is 0\ntdec.calculateHours(hours, minutes, seconds); // returns 11.758333\n\n// minutes - if hours and seconds are not provided, their default value is 0\ntdec.calculateMinutes(hours, minutes, seconds); // returns 705.5\n\n// seconds - if minutes and hours are not provided, their default value is 0\ntdec.calculateSeconds(hours, minutes, seconds); // returns 42330\n```\n\n### Browser\n\n```javascript\n\nlet hours = 11;\nlet minutes = 45;\nlet seconds = 30;\n\n// hours\ncalculateHours(hours, minutes, seconds); // returns 11.758333\n\n// minutes\ncalculateMinutes(hours, minutes, seconds); // returns 705.5\n\n// seconds\ncalculateSeconds(hours, minutes, seconds); // returns 42330\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2020 Matronator\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatronator%2Ftimedecimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatronator%2Ftimedecimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatronator%2Ftimedecimal/lists"}