From daa04395f274c2cc4c0dc7f0c1ef17579a5755e0 Mon Sep 17 00:00:00 2001 From: Jesse Gumm Date: Fri, 22 Aug 2014 23:57:23 -0500 Subject: [PATCH] Update changelog and README --- CHANGELOG.markdown | 4 ++++ README.markdown | 21 +++++++++++++++++++++ src/qdate.app.src | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 17fc398..3510b09 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,7 @@ +## 0.4.0 + +* Add basic date arithmetic + ## 0.3.0 * Add Timezone/Daylight Saving Disambiguation diff --git a/README.markdown b/README.markdown index ec37f46..cbe3735 100644 --- a/README.markdown +++ b/README.markdown @@ -614,6 +614,27 @@ ok %% that timezone to our intended timezone. ``` +## Date Arithmetic + +The current implementation of qdate's date arithmetic returns Unixtimes. + +There are 8 functions for date arithmetic: + + + `add_seconds(Seconds, Date)` + + `add_minutes(Minutes, Date)` + + `add_hours(Hours, Date)` + + `add_days(Days, Date)` + + `add_weeks(Weeks, Date)` + + `add_months(Months, Date)` + + `add_years(Years, Date)` + + `add_date(DateToAdd, Date)` - `DateToAdd` is a shortcut way of adding + numerous options. For example. `qdate:add_date({{1, 2, -3}, {-500, 20, 0}})` + will add 1 year, add 2 months, subtract 3 days, subtract 500 hours, add 20 + minutes, and not make any changes to seconds. + +For the date arithmetic functions, `Date`, like all qdate functions, can be any +format. + ## Thanks A few shoutouts to [Dale Harvey](http://github.com/daleharvey) and the diff --git a/src/qdate.app.src b/src/qdate.app.src index 73000f4..f9eafa2 100644 --- a/src/qdate.app.src +++ b/src/qdate.app.src @@ -1,7 +1,7 @@ {application, qdate, [ {description, "Simple Date and Timezone handling for Erlang"}, - {vsn, "0.3.0-pre"}, + {vsn, "0.4.0-pre"}, {registered, []}, {applications, [ kernel,