Commit 33bdcc39 authored by Alex Peters's avatar Alex Peters
Browse files

general RT::Date documentation fixes

parent f9744abf
......@@ -56,7 +56,7 @@
=head1 DESCRIPTION
RT Date is a simple Date Object designed to be speedy and easy for RT to use
RT Date is a simple Date Object designed to be speedy and easy for RT to use.
The fact that it assumes that a time of 0 means "never" is probably a bug.
......@@ -439,7 +439,7 @@ sub DurationAsString {
=head2 AgeAsString
Takes nothing. Returns a string that's the differnce between the
Takes nothing. Returns a string that's the difference between the
time in the object and now.
=cut
......@@ -450,10 +450,10 @@ sub AgeAsString { return $_[0]->DiffAsString }
=head2 AsString
Returns the object's time as a localized string with curent user's prefered
Returns the object's time as a localized string with curent user's preferred
format and timezone.
If the current user didn't choose prefered format then system wide setting is
If the current user didn't choose preferred format then system wide setting is
used or L</DefaultFormat> if the latter is not specified. See config option
C<DateTimeFormat>.
......@@ -570,7 +570,7 @@ sub Unix {
=head2 DateTime
Alias for L</Get> method. Arguments C<Date> and <Time>
Alias for L</Get> method. Arguments C<Date> and C<Time>
are fixed to true values, other arguments could be used
as described in L</Get>.
......@@ -610,7 +610,7 @@ sub Time {
=head2 Get
Returnsa a formatted and localized string that represets time of
Returns a formatted and localized string that represents the time of
the current object.
......@@ -648,7 +648,7 @@ Each method takes several arguments:
Formatters may also add own arguments to the list, for example
in RFC2822 format day of time in output is optional so it
understand boolean argument C<DayOfTime>.
understands boolean argument C<DayOfTime>.
=head3 Formatters
......@@ -805,11 +805,11 @@ sub LocalizedDateTime
=head3 ISO
Returns the object's date in ISO format C<YYYY-MM-DD mm:hh:ss>.
ISO format is locale independant, but adding timezone offset info
ISO format is locale-independent, but adding timezone offset info
is not implemented yet.
Supports arguments: C<Timezone>, C<Date>, C<Time> and C<Seconds>.
See </Output formatters> for description of arguments.
See L</Output formatters> for description of arguments.
=cut
......@@ -842,12 +842,12 @@ sub ISO {
Returns the object's date and time in W3C date time format
(L<http://www.w3.org/TR/NOTE-datetime>).
Format is locale independand and is close enought to ISO, but
Format is locale-independent and is close enough to ISO, but
note that date part is B<not optional> and output string
has timezone offset mark in C<[+-]hh:mm> format.
Supports arguments: C<Timezone>, C<Time> and C<Seconds>.
See </Output formatters> for description of arguments.
See L</Output formatters> for description of arguments.
=cut
......@@ -887,11 +887,11 @@ sub W3CDTF {
Returns the object's date and time in RFC2822 format,
for example C<Sun, 06 Nov 1994 08:49:37 +0000>.
Format is locale independand as required by RFC. Time
Format is locale-independent as required by RFC. Time
part always has timezone offset in digits with sign prefix.
Supports arguments: C<Timezone>, C<Date>, C<Time>, C<DayOfWeek>
and C<Seconds>. See </Output formatters> for description of
and C<Seconds>. See L</Output formatters> for description of
arguments.
=cut
......@@ -929,8 +929,8 @@ Returns the object's date and time in RFC2616 (HTTP/1.1) format,
for example C<Sun, 06 Nov 1994 08:49:37 GMT>. While the RFC describes
version 1.1 of HTTP, but the same form date can be used in version 1.0.
Format is fixed length, locale independand and always represented in GMT
what makes it quite useless for users, but any date in HTTP transfers
Format is fixed-length, locale-independent and always represented in GMT
which makes it quite useless for users, but any date in HTTP transfers
must be presented using this format.
HTTP-date = rfc1123 | ...
......@@ -945,7 +945,7 @@ must be presented using this format.
Supports arguments: C<Date> and C<Time>, but you should use them only for
some personal reasons, RFC2616 doesn't define any optional parts.
See </Output formatters> for description of arguments.
See L</Output formatters> for description of arguments.
=cut
......@@ -965,11 +965,11 @@ sub RFC2616 {
=head4 iCal
Returns the object's date and time in iCalendar format.
If only date requested then users timezone is used, otherwise
If only date requested then user's timezone is used, otherwise
it's UTC.
Supports arguments: C<Date> and C<Time>.
See </Output formatters> for description of arguments.
See L</Output formatters> for description of arguments.
=cut
......@@ -1020,11 +1020,19 @@ argument unix C<$time>, default value is the current unix time.
Returns object's date and time in the format provided by perl's
builtin functions C<localtime> and C<gmtime> with two exceptions:
1) "Year" is a four-digit year, rather than "years since 1900"
=over
=item 1)
"Year" is a four-digit year, rather than "years since 1900"
2) The last element of the array returned is C<offset>, which
=item 2)
The last element of the array returned is C<offset>, which
represents timezone offset against C<UTC> in seconds.
=back
=cut
sub Localtime
......@@ -1046,7 +1054,7 @@ sub Localtime
POSIX::tzset();
@local = localtime($unix);
}
POSIX::tzset(); # return back previouse value
POSIX::tzset(); # return back previous value
}
$local[5] += 1900; # change year to 4+ digits format
my $offset = Time::Local::timegm_nocheck(@local) - $unix;
......@@ -1058,16 +1066,16 @@ sub Localtime
Takes argument C<$context>, which determines whether we should
treat C<@time> as "user local", "system" or "UTC" time.
C<@time> is array returned by L<Localtime> functions. Only first
C<@time> is array returned by L</Localtime> functions. Only first
six elements are mandatory - $sec, $min, $hour, $mday, $mon and $year.
You may pass $wday, $yday and $isdst, these are ignored.
If you pass C<$offset> as ninth argument, it's used instead of
C<$context>. It's done such way as code
C<$self->Timelocal('utc', $self->Localtime('server'))> doesn't
makes much sense and most probably would produce unexpected
result, so the method ignore 'utc' context and uses offset
returned by L<Localtime> method.
C<< $self->Timelocal('utc', $self->Localtime('server')) >> doesn't
make much sense and most probably would produce unexpected
results, so the method ignores 'utc' context and uses the offset
returned by the L</Localtime> method.
=cut
......@@ -1147,7 +1155,7 @@ sub Timezone {
Returns true if this Date is set in the database, otherwise returns a false value.
This avoids needing to compare to 1970-01-01 in any of your code
This avoids needing to compare to 1970-01-01 in any of your code.
=cut
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment