doc/files/README_rdoc.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: README.rdoc</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>README.rdoc</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>README.rdoc
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Jan 03 12:45:47 -0500 2011</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<h1><a href="../classes/Timelord.html">Timelord</a></h1>
<p>
<a href="../classes/Timelord.html">Timelord</a> parses dates out of
strings. The string itself can contain non-date text - for instance:
"Call Matt on Tuesday" will return a date object for the upcoming
Tuesday.
</p>
<h2>Usage</h2>
<pre>
require 'timelord'
Timelord.parse("Tuesday").to_s # "2011-01-04"
</pre>
<p>
For more examples, check out the <a
href="https://github.com/halogenandtoast/timelord/blob/master/spec/timelord_spec.rb">spec</a>
</p>
<h2>Date format</h2>
<p>
The default date format is the international format. 11/01 is January 11th.
</p>
<p>
To use the american date format pass in :american as the second parameter
</p>
<pre>
Timelord.parse("11/01").to_s # "2011-01-11"
Timelord.parse("11/01", :american) # "2011-11-01"
</pre>
<h2>In the future</h2>
<p>
As of version 0.0.1 all dates without a year automatically choose the next
occurrence of that date. If there is demand for the ability to retrieve
previous dates, then the functionality will be added.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>