{"id":18976546,"url":"https://github.com/ahmedelserafy7/fbdateformat","last_synced_at":"2025-10-06T00:08:56.804Z","repository":{"id":56910274,"uuid":"401380989","full_name":"ahmedelserafy7/FBDateFormat","owner":"ahmedelserafy7","description":"FBDateFormat is an algorithmic library that helps developers use Facebook date format in thier application with hassle-free conversion.","archived":false,"fork":false,"pushed_at":"2021-09-23T06:59:03.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T16:47:50.524Z","etag":null,"topics":["date","dateformat","dateformatter","datetime","facebook","ios","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ahmedelserafy7.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}},"created_at":"2021-08-30T14:51:27.000Z","updated_at":"2021-09-23T06:59:05.000Z","dependencies_parsed_at":"2022-08-20T19:50:34.768Z","dependency_job_id":null,"html_url":"https://github.com/ahmedelserafy7/FBDateFormat","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelserafy7%2FFBDateFormat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelserafy7%2FFBDateFormat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelserafy7%2FFBDateFormat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelserafy7%2FFBDateFormat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedelserafy7","download_url":"https://codeload.github.com/ahmedelserafy7/FBDateFormat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239978059,"owners_count":19728271,"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":["date","dateformat","dateformatter","datetime","facebook","ios","swift"],"created_at":"2024-11-08T15:25:16.838Z","updated_at":"2025-10-06T00:08:51.784Z","avatar_url":"https://github.com/ahmedelserafy7.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FBDateFormat\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Swift-5-orange.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/version-1.0.1-blue.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/cocoapods/l/MyCocoapodsLibrary.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/cocoapods/p/MyCocoapodsLibrary.svg\" /\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/mXOkrrZ.gif\" alt=\"fbdateformat\"\u003e\n\u003c/a\u003e\n\nWelcome to FBDateFormat, an algorithmic library. I've built this library to help developers use Facebook date format in thier application with hassle-free conversion.\n\n## Installation\n\n### Using the Swift Package Manager\n\nFBDateFormat is distributed using the [Swift Package Manager](https://swift.org/package-manager). To install it into a project, go to file -\u003e Swift Packages -\u003e add it as a package dependency, then enter a package repository url which is `https://github.com/ahmedelserafy7/FBDateFormat.git`, click next and one more next, and finish.\n\nThen import FBDateFormat wherever you’d like to use it:\n\n```swift\nimport FBDateFormat\n```\n\n### CocoaPods\n\nYou can use [CocoaPods](https://cocoapods.org) by adding the following line to your `Podfile`:\n\n```ruby\npod 'FBDateFormat'\n```\n\n## How it works\n\n- Test Just now:\n\n```swift\nlet currentDate = Date()\nprint(currentDate.displayFBDateFormat())\n```\n\n- Test minutes:\n\n```swift\nlet minsAgo: Double = -60\n\nlet timeAgo = Date(timeIntervalSinceNow: minsAgo)\n//let timeAgo = Date(timeIntervalSinceNow: 2 * minsAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n\n- Test hours:\n\n```swift\nlet hrAgo: Double = 60 * minsAgo\n\nlet timeAgo = Date(timeIntervalSinceNow: hrAgo)\n//let timeAgo = Date(timeIntervalSinceNow: 2 * hrAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n\n- Test yesterday\n\n```swift\nlet dayAgo: Double = 24 * hrAgo\nlet timeAgo = Date(timeIntervalSinceNow: dayAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n\n- Let's say today is \"30/8 at 3:50 AM\". How could I still be at yesterday?\n\n```swift\nlet timeAgo = Date(timeIntervalSinceNow: dayAgo + 3 * hrAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n\n- It still doesn't exceed the day before yesterday till now:\n\n```swift\nlet timeAgo = Date(timeIntervalSinceNow: dayAgo + 3 * hrAgo + 50 * minsAgo)\nprint(timeAgo.displayFBDateFormat())\n ```       \n\n- It exceeded yesterday:\n\n```swift\nlet timeAgo = Date(timeIntervalSinceNow: dayAgo + 3 * hrAgo + minsAgo * 51)\nprint(timeAgo.displayFBDateFormat())\n```\n\n- Test days:\n\n```swift\nlet timeAgo = Date(timeIntervalSinceNow: 2 * dayAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n\n- Test weeks:\n\n```swift\nlet weekAgo = 7 * dayAgo\n\nlet timeAgo = Date(timeIntervalSinceNow: weekAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n        \n- Test months:\n\n```swift\nlet monthAgo = 4 * weekAgo\n\nlet timeAgo = Date(timeIntervalSinceNow: monthAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n- Test years:\n\n```swift\nlet yearAgo = 12 * monthAgo\n\nlet timeAgo = Date(timeIntervalSinceNow: yearAgo)\n//let timeAgo = Date(timeIntervalSinceNow: 5 * yearAgo)\nprint(timeAgo.displayFBDateFormat())\n```\n\n## Usage\n\n1. First things first, all you have to do is to import it:\n\n```swift\nimport FBDateFormat\n```\n2. Use `displayFBDateFormat` function with your `Date` data types like `postDate.displayFBDateFormat()` or `commentDate.displayFBDateFormat()`.\n\n### Note:\nYou can check/try all test cases which can be found in [`/FBDateFormatExample`](https://github.com/ahmedelserafy7/FBDateFormat/tree/master/FBDateFormatExample/FBDateFormatExample).\n\n---\n\n## Contributions and support\n\nHaving trouble working with FBDateFormat? Found a typo in the implementation? Interested in adding a feature or [fixing a bug](https://github.com/ahmedelserafy7/FBDateFormat/issues)? Then by all means [submit an issue](https://github.com/ahmedelserafy7/FBDateFormat/issues/new) or [pull request](https://help.github.com/articles/using-pull-requests/). If this is your first pull request, it may be helpful to read up on the [GitHub Flow](https://guides.github.com/introduction/flow/) first.\n\n**Please keep this in mind when requesting features and/or submitting pull requests:**\n- FBDateFormat is developed completely in the open, and your contributions are more than welcome.\n- FBDateFormat has been designed as a base for you to customize and fit your `Date` data types easily. \n- It’s highly recommended that you spend a few minutes familiarizing yourself with its internal implementation, so that you’ll be ready to tackle any issues or edge cases that you might encounter.\n\n### Pull Requests\n\nWhen submitting a pull request:\n\n1. Clone the repo.\n2. Create a branch off of `master` and give it a meaningful name (e.g. `my-awesome-new-feature`).\n3. Open a pull request on GitHub and describe the feature or fix.\n\n---\n\n## Credits\n\n### Creator\n**Ahmed Elserafy**\n- \u003cahmedelserafy17@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedelserafy7%2Ffbdateformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedelserafy7%2Ffbdateformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedelserafy7%2Ffbdateformat/lists"}