[commit: packages/time] format-widths, ghc, improve-leapseconds, master, posix-perf, tasty, wip/travis: fix Julian haddock docs (6a4e1ea)
git at git.haskell.org
git at git.haskell.org
Fri Apr 21 16:49:51 UTC 2017
- Previous message: [commit: packages/time] format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis: fix warnings; fix tests; remove GHC cruft; bump to 1.1.2.3 (578a832)
- Next message: [commit: packages/time] format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis: add Makefile for development building; remove OPTIONS -Wall -Werror in each file (a8f5da7)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Repository : ssh://git@git.haskell.org/time
On branches: format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis
Link : http://git.haskell.org/packages/time.git/commitdiff/6a4e1ea5f1a477ded35b7eedec59a55b18cbc4b1
>---------------------------------------------------------------
commit 6a4e1ea5f1a477ded35b7eedec59a55b18cbc4b1
Author: Ashley Yakeley <ashley at semantic.org>
Date: Sun Jan 4 14:43:39 2009 -0800
fix Julian haddock docs
darcs-hash:20090104224339-ac6dd-d7e1a83ebcdace7c2f9638aa855efc18f9b6b0ae
>---------------------------------------------------------------
6a4e1ea5f1a477ded35b7eedec59a55b18cbc4b1
Data/Time/Calendar/JulianYearDay.hs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Data/Time/Calendar/JulianYearDay.hs b/Data/Time/Calendar/JulianYearDay.hs
index ba10c8f..26e4660 100644
--- a/Data/Time/Calendar/JulianYearDay.hs
+++ b/Data/Time/Calendar/JulianYearDay.hs
@@ -10,7 +10,7 @@ module Data.Time.Calendar.JulianYearDay
import Data.Time.Calendar.Days
import Data.Time.Calendar.Private
--- | convert to ISO 8601 Ordinal Day format. First element of result is year (proleptic Gregoran calendar),
+-- | convert to proleptic Julian year and day format. First element of result is year (proleptic Julian calendar),
-- second is the day of the year, with 1 for Jan 1, and 365 (or 366 in leap years) for Dec 31.
toJulianYearAndDay :: Day -> (Integer,Int)
toJulianYearAndDay (ModifiedJulianDay mjd) = (year,yd) where
@@ -21,18 +21,18 @@ toJulianYearAndDay (ModifiedJulianDay mjd) = (year,yd) where
yd = fromInteger (d - (y * 365) + 1)
year = quad * 4 + y + 1
--- | convert from ISO 8601 Ordinal Day format.
+-- | convert from proleptic Julian year and day format.
-- Invalid day numbers will be clipped to the correct range (1 to 365 or 366).
fromJulianYearAndDay :: Integer -> Int -> Day
fromJulianYearAndDay year day = ModifiedJulianDay mjd where
y = year - 1
mjd = (fromIntegral (clip 1 (if isJulianLeapYear year then 366 else 365) day)) + (365 * y) + (div y 4) - 678578
--- | show in ISO 8601 Ordinal Day format (yyyy-ddd)
+-- | show in proleptic Julian year and day format (yyyy-ddd)
showJulianYearAndDay :: Day -> String
showJulianYearAndDay date = (show4 y) ++ "-" ++ (show3 d) where
(y,d) = toJulianYearAndDay date
--- | Is this year a leap year according to the proleptic Gregorian calendar?
+-- | Is this year a leap year according to the proleptic Julian calendar?
isJulianLeapYear :: Integer -> Bool
isJulianLeapYear year = (mod year 4 == 0)
- Previous message: [commit: packages/time] format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis: fix warnings; fix tests; remove GHC cruft; bump to 1.1.2.3 (578a832)
- Next message: [commit: packages/time] format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis: add Makefile for development building; remove OPTIONS -Wall -Werror in each file (a8f5da7)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ghc-commits
mailing list