{"id":26505650,"url":"https://github.com/datamart/midday","last_synced_at":"2025-03-20T21:57:59.838Z","repository":{"id":48887594,"uuid":"382555055","full_name":"Datamart/midday","owner":"Datamart","description":"🕛 Converts 24-hour (military) time string to 12-hour (meridiem) time string and vice versa.","archived":false,"fork":false,"pushed_at":"2021-11-21T00:53:26.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-03T21:18:26.831Z","etag":null,"topics":["glize-library","javascript","meridiem","military-time","time"],"latest_commit_sha":null,"homepage":"https://glize.js.org/","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/Datamart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["Datamart"],"custom":["https://www.paypal.me/vpodk","https://amzn.to/3mpgAJh"]}},"created_at":"2021-07-03T07:35:15.000Z","updated_at":"2024-05-18T16:42:21.000Z","dependencies_parsed_at":"2022-09-16T04:11:46.967Z","dependency_job_id":null,"html_url":"https://github.com/Datamart/midday","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datamart%2Fmidday","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datamart%2Fmidday/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datamart%2Fmidday/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datamart%2Fmidday/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Datamart","download_url":"https://codeload.github.com/Datamart/midday/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244695633,"owners_count":20494848,"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":["glize-library","javascript","meridiem","military-time","time"],"created_at":"2025-03-20T21:57:59.322Z","updated_at":"2025-03-20T21:57:59.832Z","avatar_url":"https://github.com/Datamart.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Datamart","https://www.paypal.me/vpodk","https://amzn.to/3mpgAJh"],"categories":[],"sub_categories":[],"readme":"# Meridiem time [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Meridiem%20time%20module%20from%20Glize%20library.\u0026url=https://glize.js.org\u0026via=GitHub\u0026hashtags=Glize,JavaScript,ECMAScript,ES6)\n[![Build Status](https://github.com/Datamart/midday/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/Datamart/midday/actions/workflows/npm-publish.yml) [![License](https://img.shields.io/:license-apache-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) [![NPM version](https://img.shields.io/npm/v/midday.svg?style=flat)](https://npmjs.org/package/midday) [![Website](https://img.shields.io/website-up-down-green-red/https/glize.js.org.svg?style=flat)](https://glize.js.org) [![NPM downloads](https://img.shields.io/npm/dm/midday.svg?style=flat)](https://npmjs.org/package/midday)\n\nConverts 24-hour (military) time string to 12-hour (meridiem) time string and vice versa..\n\n## Usage\n\n```bash\nnpm install midday --save\n```\n\n```js\nimport { toMeridiem, toMilitary } from 'midday';\n\n/**\n * Converts 24-hour (military) time string to 12-hour (meridiem) time string.\n * @param {string} time The time string (\"00:30\", \"01:45\", \"12:00\", \"22:15\").\n * @return {string} Return converted 24-hour time string to 12-hour time.\n * @throws {Error} Will throw an error if the time string is invalid.\n */\ntoMeridiem('00:30'); // 12:30 AM\ntoMeridiem('01:15'); // 1:15 AM\ntoMeridiem('11:45'); // 11:45 AM\ntoMeridiem('12:15'); // 12:15 PM\ntoMeridiem('13:15'); // 1:15 PM\ntoMeridiem('23:15'); // 11:15 PM\ntoMeridiem('0030');  // 12:30 AM\ntoMeridiem('2315');  // 11:15 PM\n\n/**\n * Converts 12-hour (meridiem) time string to 24-hour (military) time string.\n * @param {string} time The time string (\"12:30 AM\", \"11:15 PM\", \"1:15 AM\").\n * @return {string} Return converted 12-hour time string to 24-hour time.\n * @throws {!Error} Will throw an error if the time string is invalid.\n */\ntoMilitary('12:30 AM'); // 00:30\ntoMilitary('1:15 AM');  // 01:15\ntoMilitary('11:45 AM'); // 11:45\ntoMilitary('12:15 PM'); // 12:15\ntoMilitary('1:15 PM');  // 13:15\ntoMilitary('11:15 PM'); // 23:15\n```\n\nFor more information please visit [Glize project page](https://glize.js.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatamart%2Fmidday","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatamart%2Fmidday","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatamart%2Fmidday/lists"}