Commit graph

182 commits

Author SHA1 Message Date
k-hara
8506562b06 Add missing imports 2014-06-24 14:15:20 +09:00
Jonathan M Davis
aa4d081806 Merge pull request #2262 from 9rnsr/fix_imports
Rename local variables to avoid conflict with local imports
2014-06-23 21:33:30 -07:00
k-hara
3c45d63064 fix property enforcement 2014-06-21 18:44:14 +09:00
k-hara
de7430d786 Rename local variables to avoid conflict with local imports 2014-06-21 18:09:06 +09:00
jmdavis
daab9927fa Implement issue# 12886: function for parsing RFC822/5322 date-time format.
The RFC 822 / 5322 date-time format should be taken out and shot, but
unfortunately, it _is_ used in e-mail, HTTP, RTSP, etc. Most code which
deals with it is probably going to need to handle the rest of whatever
spec it's interacting with rather than just the date-time format, but
there are cases where this would be useful on its own (e.g. Martin
apparently needs something like this in the dmd installer), so I'm
adding a function to parse this format and return a SysTime to
std.datetime.

However, that's all I'm adding. I find it very hard to believe that
anyone who needs to produce this particular format doesn't need a lot of
other functionality specific to whatever spec they're dealing with, and
the function for generating the date-time format presumably will be
included with that (and I definitely don't want to encourage this
format's use anyway, since it's a horrible format). So, I'm just adding
a function for parsing the format, not generating it.

parseRFC822DateTime _should_ fully and correctly implement the format as
outlined in RFC 5322 (including the obsolete syntax from RFC 822 that no
one is supposed to be generating anymore and the comment folding
whitespace nonsense that should never have been legal anywhere but at
the end). And the tests are quite thorough, so it's unlikely that I
missed anything, but you never know.
2014-06-17 23:01:39 -07:00
jmdavis
ca72720188 Make std.datetime.SysTime @safe. 2014-06-13 03:39:49 -07:00
jmdavis
e9d970506a Make time zones @safe. 2014-06-13 03:39:45 -07:00
jmdavis
9900470df2 Make std.datetime.DateTime @safe. 2014-06-13 03:00:30 -07:00
jmdavis
93387f0b95 Make std.datetime.TimeOfDay @safe. 2014-06-13 03:00:27 -07:00
jmdavis
75d04b5cf2 Make std.datetime.Date @safe. 2014-06-13 03:00:24 -07:00
jmdavis
73cf16849e Fix deprecation messages caused by recent changes to Duration. 2014-06-11 20:43:32 -07:00
jmdavis
78c2ed05f9 More ref return fixes in std.datetime now that the compiler allows them. 2014-06-03 00:43:54 -07:00
jmdavis
d03f379009 Fix functions which are supposed to return by ref in Date.
Compiler bugs previously prevented these functions from returning by
ref.
2014-06-01 18:32:50 -07:00
jmdavis
7758e81cc0 Fix functions which are supposed to return by ref in SysTime.
Compiler bugs previously prevented these functions from returning by
ref.
2014-06-01 18:32:29 -07:00
jmdavis
8c1f68d6e3 Remove now-unneeded workaround for bug# 4866. 2014-06-01 17:36:25 -07:00
jmdavis
47eb71f40a Fix issue 12828: Fix return type of SimpleTimeZone.utcOffset. 2014-05-31 13:27:31 -07:00
k-hara
f2d8ef6874 fix import declarations 2014-05-29 15:58:41 +09:00
jmdavis
a00adccc41 Converted more of std.datetime's examples to ddoc-ed unit tests.
The ones at the end which are removed from the docs are removed because
they're private, so there's no point in having an example in their
documentation.
2014-05-26 21:07:59 -07:00
jmdavis
a5a4d98ea1 Some cleanup of std.datetime.
This is mostly some cleanup which takes advantage of some stuff like
format being pure now, but it also removes the long month name and
case-insensitive months for simple time. I don't know why it was there
(probably idiocy on my part), and it violates the format for simple time
as defined by the documentation.
2014-05-24 16:05:41 -07:00
jmdavis
020c3a06bf Reformat some ddoc-ed examples so that they're not so long. 2014-05-20 04:27:10 -07:00
jmdavis
99dfa7fd15 Convert std.datetime.Datetime to use ddoc-ed unit tests. 2014-05-20 04:10:15 -07:00
jmdavis
7125352a32 Make std.datetime.Date use ddoc-ed unittests. 2014-05-19 20:02:03 -07:00
jmdavis
77f9f55e2d Convert SysTime's examples to ddoc-ed unittests. 2014-05-18 19:22:19 -07:00
jmdavis
1e10cb7715 Remove the rest of version(testStdDateTime) from std.datetime. 2014-04-30 00:41:38 -07:00
jmdavis
215c81d870 Remove version(testStdDateTime) from std.datetime's interval types. 2014-04-30 00:38:28 -07:00
jmdavis
cc4efc24f0 Remove version(testStdDateTime) from DateTime. 2014-04-30 00:36:36 -07:00
jmdavis
bdd745c2dc Remove version(testStdDateTime) from TimeOfDay. 2014-04-30 00:36:08 -07:00
jmdavis
291c9a8489 Remove version(testStdDateTime) from Date. 2014-04-30 00:35:29 -07:00
jmdavis
9d252dfed5 Remove version(testStdDateTime) from SysTime.
It's no longer necessary and hasn't been for some time (it was to deal
with the fact that dmd ran out of memory on Windows when compiling
std.datetime's unit tests, which hasn't been a problem for a while). So,
we're removing it.
2014-04-30 00:34:44 -07:00
Andrei Alexandrescu
422f59d487 Eliminate _assertPred 2014-03-17 19:26:40 -07:00
Jonathan M Davis
0b066c74f5 Merge pull request #1898 from schuetzm/tzif3
Support TZif format v3
2014-02-05 04:32:10 -08:00
jmdavis
6c08a1e526 Fix issue 12067.
Note that the measureTime examples do not use documented unittest
blocks, because that doesn't work when the documentation is split out
into a separate version(StdDDoc) section.
2014-02-04 00:43:23 -08:00
Marc Schütz
fd18074787 Support TZif format v3
The only difference between v2 and v3 is an extension of the POSIX-TZ-style
string, which Phobos doesn't use anyway.
2014-02-01 20:19:07 +01:00
Martin Nowak
8f52f11753 replace use of deprecated canFind overload
- !canFind(not!isDigit) == all!isDigit
2014-01-24 00:55:07 +01:00
Vladimir Panteleev
c53b1c77a0 DDoc fixes
This fixes some warnings as identified by the compiler,
as well as some broken cross-reference links caused by
DDoc auto-formatting of the current symbol.
2013-12-28 21:28:41 +00:00
Walter Bright
0248950d8e add lref links to std.datetime 2013-12-27 17:23:32 -08:00
e10s
2df2d2ea9d change some ddoc comments to /++ Ditto +/ 2013-12-13 00:25:21 +09:00
e10s
155326ede5 make non-ref opAssigns call the ref overload 2013-12-13 00:21:06 +09:00
e10s
099737501d add opAssign with non-ref param to each IntervalRange 2013-12-09 01:09:13 +09:00
Daniel Murphy
fed89857e7 Fix missed cases of <>= operator 2013-12-01 16:31:47 +11:00
k-hara
8cf0263f03 fix Issue 11489, add cast from const(LocalTime) to immutable 2013-11-13 13:35:04 +09:00
k-hara
d78079b362 Add "Africa/Tripoli" from/to "Libya Standard Time" 2013-08-17 01:16:09 +09:00
k-hara
b06fe4b8e9 Fix std.datetime (remove ReturnType usage for property check) 2013-06-03 23:50:12 +09:00
jmdavis
a445982fb8 Make UTC and LocalTime singletons be instantiated with CTFE.
Yay! It's now possible to instantiate classes at compile time and then
use them at runtime.
2013-05-04 21:07:11 -07:00
jmdavis
8f7f6d69ac Remove some undocumented, deprecated functions which are slated for removal.
These have been deprecated for a while, but there was some balking
(primarily from Andrei IIRC) at actually removing them when they were
slated for removal, so they were instead made undocumented and slated
for removal after yet another 6 months or so. So, now that that time has
passed, here's another attempt to actually remove them.
2013-03-06 22:19:34 -08:00
k-hara
4785bc179f Fix qualifier to call correct constructor 2013-03-06 21:36:41 +09:00
jmdavis
2735d30f4e Remove all uses of std.metastrings.Format. 2013-02-24 18:42:46 -08:00
k-hara
d4b6479093 fix incorrect method access 2013-02-24 13:05:39 +09:00
jmdavis
ab9c275962 Fix for issue# 9214.
I don't think that it makes any sense for core.time.TickDuration.to to
be a property, since it's a conversion function, not an abstraction for
a variable. However, it _does_ make sense for the example to use one of
TickDuration's property functions instead (it makes the code cleaner
too). So, I've done that. And if the property debate results in
non-property functions being allowed to be called without parens (as
currently seems likely), then anyone wanting to use the to function
without the extra parens can do so then.
2012-12-26 22:27:39 -08:00
Andrei Alexandrescu
d6100b404f Merge pull request #939 from 9rnsr/replace_format
Replacement std.string.format and sformat implementations in November 2012
2012-12-08 19:41:35 -08:00