[翻译] NSDate-TimeAgo
NSDate-TimeAgo

https://github.com/kevinlawler/NSDate-TimeAgo
NSDate+TimeAgo has merged with DateTools. DateTools is the parent project and Matthew York is the project head.
NSDate+TimeAgo是一个处理日期用的工具,他是Matthew York项目中的一部分.
This project is now part of DateTools. Please visit https://github.com/MatthewYork/DateTools
你可以在 https://github.com/MatthewYork/DateTools 中查看相关信息.
This repo is here in archive form. New work should be contributed to DateTools.
这个资源只是一个存档的形式.我们只会在New work里面更新关于这个资源的信息.
Description
This is an iOS, Objective-C, Cocoa Touch, iPhone, iPad category for NSDate. It gives NSDate the ability to report times like "A moment ago", "30 seconds ago", "5 minutes ago", "Yesterday", "Last month", "2 years ago", and so on.
这是用于苹果开发中的关于NSDate的category.你可以这么用"A moment ago", "30 seconds ago", "5 minutes ago", "Yesterday", "Last month", "2 years ago"
This functionality has variously been referred to as a "time ago", "time since", "relative date", or "fuzzy date" feature.
当然也支持这些"time ago", "time since", "relative date", or "fuzzy date"特性
NSDate+TimeAgo currently supports the following languages:
目前,他支持以下这些语言:
- en (English)
- es (Spanish)
- zh_Hans (Chinese Simplified)
- zh_Hant (Chinese Traditional)
- pt (Portuguese)
- fr (French)
- it (Italian)
- ru (Russian)
- de (German)
- nl (Dutch)
- hu (Hungarian)
- fi (Finnish)
- ja (Japanese)
- vi (Vietnamese)
- ro (Romanian)
- da (Danish)
- cs (Czech)
- nb (Norwegian)
- lv (Latvian)
- tr (Turkish)
- ko (Korean)
- bg (Bulgarian)
- he (Hebrew)
- ar (Arabic)
- gre (Greek)
- pl (Polish)
- sv (Swedish)
- th (Thai)
- uk (Ukrainian)
- is (Icelandic)
- sq (Albanian)
- sk (Slovak)
If you know a language not listed here, please consider submitting a translation. Localization codes by language.
如果你的母语不在这份列表中,你可以可以提供一份翻译的列表.
This project is user driven (by people like you). Pull requests close faster than issues (merged or rejected).
这份源码需要我们一起来维护,如果你喜欢,贡献你的一份力量吧.
Use
Addthe files to your project - manually or via Cocoapods (pod 'NSDate+TimeAgo') 你可以直接拖源码,或者是使用Cocoapods- Import the header using
#import "NSDate+TimeAgo.h" 然后倒入头文件 - Call the
timeAgomethod in the following way: 调用
NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:0];
NSString *ago = [date timeAgo];
NSLog(@"Output is: \"%@\"", ago);
2011-11-12 17:19:25.608 Proj[0:0] Output is: "41 years ago"
2 other methods are available: 当然也支持这些方法
dateTimeAgo: returns times with only strings of the type: "{value} {unit} ago"dateTimeUntilNow: returns only "yesterday" / "this morning" / "last week" / "this month" -- less precise thandateTimeAgobut more natural
Those three methods can be interchanged as they have the same signature.
Future Directions
Would be nice to
- add customization options (e.g., should it report seconds or just "a minute ago") 添加定制选项
- add string customization 添加string的定制
- have more localizations 更多的本地化语言
- make
dateTimeUntilNowmore precise: instead of "Last week" use "Last Friday", "Last Monday" etc. - other
License
Released under ISC (similar to 2-clause BSD)
http://wikipedia.org/wiki/ISC_license
Credits
Originally based on code Christopher Pickslay posted to Forrst. Used with permission.http://twitter.com/cpickslay
Ramon Torres began support for internationalization/localization. Added es strings. http://rtorres.me/
Dennis Zhuang added zh_Hans Chinese Simplified strings. http://fnil.net/
Mozart Petter added pt_BR Brazilian Portuguese strings. http://www.mozartpetter.com/
Stéphane Gerardot added fr French strings.
Marco Sanson added it Italian strings. http://marcosanson.tumblr.com/
Almas Adilbek added ru Russian strings. Extended logic to support Russian idioms.http://mixdesign.kz/
Mallox51 added de German strings. https://github.com/Mallox51
Tieme van Veen added nl Dutch strings. http://www.tiemevanveen.nl
Árpád Goretity added hu Hungarian strings. http://apaczai.elte.hu/~13akga/
Anajavi added fi Finnish strings. https://github.com/anajavi
Tonydyb added ja Japanese strings.
Vinhnx added vi Vietnamese strings. http://vinhnx.github.io/
Ronail added zh_Hant Traditional Chinese strings. https://github.com/ronail
SorinAntohi added ro Romanian strings. https://github.com/SorinAntohi
spookd added da Danish strings. https://github.com/spookd
Barrett Jacobsen added cs Czech strings. https://github.com/barrettj
Dmitry Shmidt added nb Norwegian strings. https://github.com/shmidt
Martins Rudens added lv Latvian strings. https://github.com/rudensm
Osman Saral added tr Turkish strings. https://github.com/osrl
analogstyle added ko Korean strings. http://almacreative.net/
Flavio Caetano fixed pt Portuguese strings. http://flaviocaetano.com
kolarski added bg Bulgarian strings. http://github.com/kolarski
Vladimir Kofman added he Hebrew strings. https://github.com/vladimirkofman
Viraf Sarkari added ar Arabic, gre Greek, pl Polish, sv Swedish, and th Thai strings.https://github.com/viraf
Vasyl Skrypii added uk Ukranian strings. https://github.com/medlay
Maggi Trymbill added is Icelandic strings. https://github.com/grundvollur
Erid Bardhaj added sq Albanian strings. https://github.com/eridbardhaj
[翻译] NSDate-TimeAgo的更多相关文章
- <转>iOS性能优化:Instruments使用实战
最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有 ...
- iOS性能优化:Instruments使用实战
iOS性能优化:Instruments使用实战 最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instrument ...
- iOS---性能优化
最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧.小结如下. Instruments使用技巧 关于Instruments官方有一个很有 ...
- 最近采用Instruments
最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有 ...
- iOS性能优化
最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有 ...
- OS快速开发必备
github:https://github.com/koknine (终于改成以前的了) 当前移动互联网行业太火爆,移动端的需求日益增长,很多开发人员每天都应对着各种需求,作为一名iOS开发人员,对于 ...
- Instruments使用实战
http://www.cocoachina.com/ios/20150225/11163.html 最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析 ...
- iOS - 性能优化:Instruments使用简介
最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有 ...
- iOS开发中可能有用的那些分类们Categories
Categories是给你得不到源码的classes增加功能的一种方法. UIImageView+FaceAwareFill 这个类别使用了Aspect Fill内容模式,可以自动根据图像内容进行调整 ...
随机推荐
- C++11中多线程库
一.Linux 线程API 线程是在操作系统层面支持的,所以多线程的学习建议还是先找一本linux系统编程类的书,了解linux提供线程的API,了解使用线程设计程序的基本操纵.完全使用系统调用编写多 ...
- H5开发中遇到的问题及解决办法
记不得什么时候进行H5开发的学习了,只知道是从2016年8月1日开始修复Bug,计划每天把学到的东西以及遇到问题时候的解决方案都记录下来,希望自己能够坚持下去,每天积累一点,希望有所进步吧. 1.Th ...
- JAVA 导出 Excel, JS 导出 Excel
本介绍两种Excle导出方法: JAVA 导出 Excle, JS 导出 Excle 1, js 根据 html 页面的 table > tr > td 标签导出 js代码: //导出 v ...
- 通过spark-sql快速读取hive中的数据
1 配置并启动 1.1 创建并配置hive-site.xml 在运行Spark SQL CLI中需要使用到Hive Metastore,故需要在Spark中添加其uris.具体方法是将HIVE_CON ...
- angular 下载文件
后台直接返回文件即可,以wcf为例:读取目录文件返回,或直接生成文件并返回. public Stream GetCodeSn() { return File.OpenRead("e:\\工作 ...
- [转]使用Visual Studio Code开发Asp.Net Core WebApi学习笔记(三)-- Logger
本文转自:https://www.cnblogs.com/niklai/p/5662094.html 本篇是在上一篇的基础上添加日志功能,并记录NLog在Asp.Net Core里的使用方法. 第一部 ...
- Rafy中的IOC
Rafy是什么可以通过下面博客来了解 Rafy 领域实体框架演示(3) - 快速使用 C/S 架构部署 - BloodyAngel - 博客园 以下是看源码中的一点记录,供以后学习使用 主要是Rafy ...
- python之协程gevent模块
Gevent官网文档地址:http://www.gevent.org/contents.html 进程.线程.协程区分 我们通常所说的协程Coroutine其实是corporate routine的缩 ...
- QT的信号和槽机制简介
信号与槽作为QT的核心机制在QT编程中有着广泛的应用,本文介绍了信号与槽的一些基本概念.元对象工具以及在实际使用过程中应注意的一些问题. QT是一个跨平台的C++ GUI应用构架,它提供了丰富的窗口部 ...
- Qt程序Release版出现 类似 QEventLoop: Cannot be used without QApplication 问题的终极解决方案
最近在做Qt程序开发,程序在Debug下跑是没有问题的,发布到Release版本后,出现各种问题: 报各种莫名其妙的错误,类似的错误有: QEventLoop:Cannot be used wit ...