Skip to content

Commit

Permalink
Merge branch 'release/4.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Oct 24, 2016
2 parents 487858e + 228f54e commit 598329b
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 106 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

## CHANGELOG

### SwiftDate 4.0.7
Released on: Mon Oct 24, 2016, [Download](https://github.com/malcommac/SwiftDate/releases/tag/4.0.7)
* [#306](https://github.com/malcommac/SwiftDate/issues/306) Fixed a date ordering issue with time interval
* [#308](https://github.com/malcommac/SwiftDate/issues/308) Added singular component for `.year,.month,.day,.hour,.minute,.second` time components
* [#309](https://github.com/malcommac/SwiftDate/issues/309) Added Traditional Chinese support (thanks to @rynecheow)
* [#314](https://github.com/malcommac/SwiftDate/issues/314) Restored French translation strings

### SwiftDate 4.0.6
Released on: Mon Oct 17, 2016, [Download](https://github.com/malcommac/SwiftDate/releases/tag/4.0.6)
* [#303](https://github.com/malcommac/SwiftDate/issues/303) `Date.defaultRegion()` is now set to `Region.Local()` as specified in doc (not `Region.GMT()`)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Choose SwiftDate for your next project, or migrate over your existing projects
## Main features
That's an highlight of the main features you can found in SwiftDate:

* **Simple math operation with dates!** Example: `aDate + 2.weeks + 1.hours or (1.years - 2.hours + 16.minutes).fromNow()`
* **Simple math operation with dates!** Example: `aDate + 2.weeks + 1.hour or (1.year - 2.hours + 16.minutes).fromNow()`
* **Easy conversions to and from timezone, locale and calendar**. Use helper class `DateInRegion` and perform conversions with components and operations!
* **Compare dates with math operators** `<,>,==,<=,>=`. For example you can do `aDate1 >= aDate2 or aDate1.isIn(anotherDate,.day)`
* **Easily work with time components**. E.g. `aDateInRegion.day` or `hour`, `minutes` etc. expressed in your favourite timezone!
Expand Down Expand Up @@ -46,7 +46,7 @@ You can also generate latest documentation using [Jazzy](https://github.com/real

## Current Release

Last release is: 4.0.6 [Download here](https://github.com/malcommac/SwiftDate/releases/tag/4.0.6) released on Mon, Oct 17, 2016.
Last release is: 4.0.7 [Download here](https://github.com/malcommac/SwiftDate/releases/tag/4.0.7) released on Mon, Oct 24, 2016.

A complete list of changes for each release is available in [CHANGELOG](CHANGELOG.md) file.

Expand All @@ -61,7 +61,8 @@ Currently SwiftDate supports:
* Dutch (made by [hout](https://github.com/Hout), since 4.0.0)
* French (made by [pierrolivier](https://github.com/pierrolivier), since 4.0.5)
* Indonesian (made by [suprie](https://github.com/suprie), since 4.0.5)
* Chinese (made by [codingrhythm](https://github.com/codingrhythm), since 4.0.5)
* Simplified Chinese (made by [codingrhythm](https://github.com/codingrhythm), since 4.0.5)
* Traditional Chinese (made by [rynecheow](https://github.com/rynecheow), since 4.0.7)

Make a pull request and add your language!

Expand Down
15 changes: 15 additions & 0 deletions Sources/SwiftDate/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,18 @@ public extension Int {
}
}


/// Singular variations of Int extension for DateComponents for readability
/// - note these properties behave exactly as their plural-named equivalents

public extension Int {
public var nanosecond: DateComponents { return nanoseconds }
public var second: DateComponents { return seconds }
public var minute: DateComponents { return minutes }
public var hour: DateComponents { return hours }
public var day: DateComponents { return days }
public var week: DateComponents { return weeks }
public var month: DateComponents { return months }
public var year: DateComponents { return years }
}

48 changes: 48 additions & 0 deletions Sources/SwiftDate/SwiftDate.bundle/fr.lproj/SwiftDate.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// COLLOQUIAL STRINGD
"colloquial_f_y" = "l'année prochaine"; // year,future,singular: "next year"
"colloquial_f_yy" = "en %d"; // year,future,plural: "on 2016"
"colloquial_p_y" = "l'année dernière"; // year,past,singular: "last year"
"colloquial_p_yy" = "%d"; // year,past,plural: "2015"

"colloquial_f_m" = "le mois prochain"; // month,future,singular: "next month"
"colloquial_f_mm" = "dans %d mois"; // month,future,plural: "in 3 months"
"colloquial_p_m" = "le mois dernier"; // month,past,singular: "past month"
"colloquial_p_mm" = "il y a %d mois"; // month,past,plural: "3 months ago"

"colloquial_f_w" = "la semaine prochaine"; // week,future,singular: "next week"
"colloquial_f_ww" = "dans %ld semaines"; // week,future,plural: "in 3 weeks"
"colloquial_p_w" = "la semaine dernière"; // week,past,singular: "past week"
"colloquial_p_ww" = "il y a %d semaines"; // week,past,plural: "in 3 weeks"

"colloquial_f_d" = "demain"; // day,future,singular: "tomorrow"
"colloquial_f_dd" = "dans %d jours"; // day,future,plural: "in 3 days"
"colloquial_p_d" = "hier"; // day,past,singular: "yesterday"
"colloquial_p_dd" = "il y a %d jours"; // day,past,plural: "3 days ago"

"colloquial_f_h" = "dans une heure"; // hour,future,singular: "in one hour"
"colloquial_f_hh" = "dans %ld heures"; // hour,future,plural: "in 3 hours"
"colloquial_p_h" = "il y a une heure"; // hour,past,singular: "one hour ago"
"colloquial_p_hh" = "il y a %d heures"; // hour,past,plural: "3 hours ago"

"colloquial_f_M" = "dans une minute"; // minute,future,singular: "in one minute"
"colloquial_f_MM" = "dans %ld minutes"; // minute,future,plural: "in 3 minutes"
"colloquial_p_M" = "il y a une minute"; // minute,past,singular: "one minute ago"
"colloquial_p_MM" = "il y a %d minutes"; // minute,past,plural: "3 minutes ago"

"colloquial_now" = "à l'instant"; // less than 5 minutes if .allowsNowOnColloquial is set

// RELEVANT TIME TO PRINT ALONG COLLOQUIAL STRING WHEN .includeRelevantTime = true
"relevanttime_y" = "MMM yyyy"; // for colloquial year (=+-1) adds a time string like this:"(Feb 2016)"
"relevanttime_yy" = "MMM yyyy"; // for colloquial years (>1) adds a time string like this:"(Feb 2016)"
"relevanttime_m" = "dd MMM yyyy"; // for colloquial month (=+-1) adds a time string like this:"(Feb 17, 2016)"
"relevanttime_mm" = "dd MMM yyyy"; // for colloquial months (>1) adds a time string like this: "(Feb 17, 2016)"
"relevanttime_w" = "EEE dd MMM"; // for colloquial months (>1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_ww" = "EEE dd MMM"; // for colloquial months (>1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_d" = "EEE dd MMM"; // for colloquial day (=+-1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_dd" = "EEE dd MMM"; // for colloquial days (>1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_h" = "'à' HH:mm"; // for colloquial day (=+-1) adds a time string like this: "(At 13:20)"
"relevanttime_hh" = "'à' HH:mm"; // for colloquial days (>1) adds a time string like this: "(At 13:20)"
"relevanttime_M" = ""; // for colloquial minute(s) we have not any relevant time to print
"relevanttime_MM" = ""; // for colloquial minute(s) we have not any relevant time to print
"relevanttime_s" = ""; // for colloquial seconds(s) we have not any relevant time to print
"relevanttime_ss" = ""; // for colloquial seconds(s) we have not any relevant time to print
48 changes: 48 additions & 0 deletions Sources/SwiftDate/SwiftDate.bundle/zh-Hant.lproj/SwiftDate.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// COLLOQUIAL STRINGD
"colloquial_f_y" = "明年"; // year,future,singular: "next year"
"colloquial_f_yy" = "%d"; // year,future,plural: "on 2016"
"colloquial_p_y" = "去年"; // year,past,singular: "last year"
"colloquial_p_yy" = "%d"; // year,past,plural: "2015"

"colloquial_f_m" = "下個月"; // month,future,singular: "next month"
"colloquial_f_mm" = "%d個月後"; // month,future,plural: "in 3 months"
"colloquial_p_m" = "上個月"; // month,past,singular: "past month"
"colloquial_p_mm" = "%d個月前"; // month,past,plural: "3 months ago"

"colloquial_f_w" = "下週"; // week,future,singular: "next week"
"colloquial_f_ww" = "%ld週後"; // week,future,plural: "in 3 weeks"
"colloquial_p_w" = "上週"; // week,past,singular: "past week"
"colloquial_p_ww" = "%d週前"; // week,past,plural: "in 3 weeks"

"colloquial_f_d" = "明天"; // day,future,singular: "tomorrow"
"colloquial_f_dd" = "%d天後"; // day,future,plural: "in 3 days"
"colloquial_p_d" = "昨天"; // day,past,singular: "yesterday"
"colloquial_p_dd" = "%d天前"; // day,past,plural: "3 days ago"

"colloquial_f_h" = "1小時後"; // hour,future,singular: "in one hour"
"colloquial_f_hh" = "%ld小時後"; // hour,future,plural: "in 3 hours"
"colloquial_p_h" = "1小時前"; // hour,past,singular: "one hour ago"
"colloquial_p_hh" = "%d小時前"; // hour,past,plural: "3 hours ago"

"colloquial_f_M" = "1分鐘後"; // minute,future,singular: "in one minute"
"colloquial_f_MM" = "%ld分鐘後"; // minute,future,plural: "in 3 minutes"
"colloquial_p_M" = "1分鐘前"; // minute,past,singular: "one minute ago"
"colloquial_p_MM" = "%d分鐘前"; // minute,past,plural: "3 minutes ago"

"colloquial_now" = "剛剛"; // less than 5 minutes if .allowsNowOnColloquial is set

// RELEVANT TIME TO PRINT ALONG COLLOQUIAL STRING WHEN .includeRelevantTime = true
"relevanttime_y" = "yyyy年MMM"; // for colloquial year (=+-1) adds a time string like this:"(Feb 2016)"
"relevanttime_yy" = "yyyy年MMM"; // for colloquial years (>1) adds a time string like this:"(Feb 2016)"
"relevanttime_m" = "yyyy年MMMdd日"; // for colloquial month (=+-1) adds a time string like this:"(Feb 17, 2016)"
"relevanttime_mm" = "yyyy年MMMdd日"; // for colloquial months (>1) adds a time string like this: "(Feb 17, 2016)"
"relevanttime_w" = "MMMdd日 EEE"; // for colloquial months (>1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_ww" = "MMMdd日 EEE"; // for colloquial months (>1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_d" = "MMMdd日 EEE"; // for colloquial day (=+-1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_dd" = "MMMdd日 EEE"; // for colloquial days (>1) adds a time string like this: "(Wed Feb 17)"
"relevanttime_h" = "'在' HH:mm"; // for colloquial day (=+-1) adds a time string like this: "(At 13:20)"
"relevanttime_hh" = "'在' HH:mm"; // for colloquial days (>1) adds a time string like this: "(At 13:20)"
"relevanttime_M" = ""; // for colloquial minute(s) we have not any relevant time to print
"relevanttime_MM" = ""; // for colloquial minute(s) we have not any relevant time to print
"relevanttime_s" = ""; // for colloquial seconds(s) we have not any relevant time to print
"relevanttime_ss" = ""; // for colloquial seconds(s) we have not any relevant time to print
2 changes: 1 addition & 1 deletion SwiftDate.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'SwiftDate'
spec.version = '4.0.6'
spec.version = '4.0.7'
spec.summary = 'The best way to deal with Dates & Time Zones in Swift'
spec.homepage = 'https://github.com/malcommac/SwiftDate'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
Loading

0 comments on commit 598329b

Please sign in to comment.