/ArabicTimeAgo

Arabic and English time ago in Swift

Primary LanguageShellMIT LicenseMIT

ArabicTimeAgo

[![CI Status](http://img.shields.io/travis/Abdulmomen Kadum عبدالمؤمن كاظم/ArabicTimeAgo.svg?style=flat)](https://travis-ci.org/Abdulmomen Kadum عبدالمؤمن كاظم/ArabicTimeAgo) Version License Platform

Screenshot

Usage

import ArabicTimeAgo
...

let itemDateStr = "2017-01-19 09:12:07"
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"

if let date = formatter.date(from: itemDateStr) {
  print(TimeAgo.calculate(date: date, isAr: true))  // قبل 13 ساعة
  print(TimeAgo.calculate(date: date, isAr: false)) // 13 hours ago
}

Requirements

Swift 3

Installation

ArabicTimeAgo is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ArabicTimeAgo"

Author

Abdulmomen Kadum عبدالمؤمن كاظم, a.bluemix@gmail.com

License

ArabicTimeAgo is available under the MIT license. See the LICENSE file for more info.