Class: Date
- Inherits:
-
Object
- Object
- Date
- Extended by:
- FatCore::Date::ClassMethods
- Includes:
- FatCore::Date
- Defined in:
- lib/fat_core/date.rb
Utilities collapse
- .days_in_month(y, m) ⇒ Object extended from FatCore::Date::ClassMethods
-
.easter(year) ⇒ ::Date
extended
from FatCore::Date::ClassMethods
Return the date of Easter for the Western Church in the given year.
-
.nth_wday_in_year_month(n, wday, year, month) ⇒ Object
extended
from FatCore::Date::ClassMethods
Return the nth weekday in the given month.
Parsing collapse
-
.parse_american(str) ⇒ ::Date
extended
from FatCore::Date::ClassMethods
Convert a string +str+ with an American style date into a ::Date object.
-
.parse_spec(spec, spec_type = :from) ⇒ ::Date
extended
from FatCore::Date::ClassMethods
Convert a 'period spec'
specto a ::Date.
Relative ::Dates collapse
-
#add_chunk(chunk, n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is n chunks later than self.
-
#beginning_of_bimonth ⇒ ::Date
included
from FatCore::Date
The date that is the first day of the bimonth in which self falls.
-
#beginning_of_biweek ⇒ ::Date
included
from FatCore::Date
Return the date that is the first day of the commercial biweek in which self falls.
-
#beginning_of_chunk(chunk) ⇒ ::Date
included
from FatCore::Date
Return the date that is the beginning of the +chunk+ in which this date falls.
-
#beginning_of_half ⇒ ::Date
included
from FatCore::Date
The date that is the first day of the half-year in which self falls.
-
#beginning_of_semimonth ⇒ ::Date
included
from FatCore::Date
The date that is the first day of the semimonth in which self falls.
-
#easter_this_year ⇒ ::Date
included
from FatCore::Date
Return the date for Easter in the Western Church for the year in which this date falls.
-
#end_of_bimonth ⇒ ::Date
included
from FatCore::Date
The date that is the last day of the bimonth in which self falls.
-
#end_of_biweek ⇒ ::Date
included
from FatCore::Date
Return the date that is the last day of the commercial biweek in which self falls.
-
#end_of_chunk(chunk) ⇒ ::Date
included
from FatCore::Date
Return the date that is the end of the +chunk+ in which this date falls.
-
#end_of_half ⇒ ::Date
included
from FatCore::Date
The date that is the last day of the half-year in which self falls.
-
#end_of_semimonth ⇒ ::Date
included
from FatCore::Date
The date that is the last day of the semimonth in which self falls.
-
#next_bimonth(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ calendar bimonths after this date, where a calendar bimonth is a period of 2 months.
-
#next_biweek(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ biweeks after this date where each biweek is 14 days.
-
#next_half(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ calendar halves after this date, where a calendar half is a period of 6 months.
-
#next_quarter(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ calendar quarters after this date, where a calendar quarter is a period of 3 months.
-
#next_semimonth(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ semimonths after this date.
-
#next_week(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ weeks after this date where each week is 7 days.
-
#pred ⇒ ::Date
included
from FatCore::Date
Predecessor of self, opposite of
#succ. -
#prior_bimonth(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ calendar bimonths before this date, where a calendar bimonth is a period of 2 months.
-
#prior_biweek(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ biweeks before this date where each biweek is 14 days.
-
#prior_day(n) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ weeks before this date where each week is 7 days.
-
#prior_half(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ calendar halves before this date, where a calendar half is a period of 6 months.
-
#prior_quarter(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ calendar quarters before this date, where a calendar quarter is a period of 3 months.
-
#prior_semimonth(n = 1) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ semimonths before this date.
-
#prior_week(n) ⇒ ::Date
included
from FatCore::Date
Return the date that is +n+ weeks before this date where each week is 7 days.
Federal Holidays and Workdays collapse
-
#add_fed_workdays(n) ⇒ ::Date
included
from FatCore::Date
Return the date that is n federal workdays after or before (if n < 0) this date.
-
#fed_holiday? ⇒ Boolean
included
from FatCore::Date
Return whether this date is a United States federal holiday.
-
#fed_workday? ⇒ Boolean
included
from FatCore::Date
Return whether this date is a date on which the US federal government is open for business.
-
#next_fed_workday ⇒ ::Date
included
from FatCore::Date
Return the next federal workday after this date.
-
#next_until_fed_workday ⇒ ::Date
included
from FatCore::Date
Return this date if its a federal workday, otherwise skip forward to the first later federal workday.
-
#prior_fed_workday ⇒ ::Date
included
from FatCore::Date
Return the last federal workday before this date.
-
#prior_until_fed_workday ⇒ Object
included
from FatCore::Date
Return this if its a federal workday, otherwise skip back to the first prior federal workday.
NYSE Holidays and Workdays collapse
-
#add_nyse_workdays(n) ⇒ ::Date
(also: #add_trading_days)
included
from FatCore::Date
Return the date that is n NYSE trading days after or before (if n < 0) this date.
-
#next_nyse_workday ⇒ ::Date
(also: #next_trading_day)
included
from FatCore::Date
Return the next NYSE trading day after this date.
-
#next_until_trading_day ⇒ ::Date
included
from FatCore::Date
Return this date if its a trading day, otherwise skip forward to the first later trading day.
-
#nyse_holiday? ⇒ Boolean
included
from FatCore::Date
Returns whether this date is one on which the NYSE was or is expected to be closed for business.
-
#nyse_workday? ⇒ Boolean
(also: #trading_day?)
included
from FatCore::Date
Return whether the NYSE is open for trading on this date.
-
#prior_nyse_workday ⇒ ::Date
(also: #prior_trading_day)
included
from FatCore::Date
Return the last NYSE trading day before this date.
-
#prior_until_trading_day ⇒ ::Date
included
from FatCore::Date
Return this date if its a trading day, otherwise skip back to the first prior trading day.
Formatting collapse
-
#american ⇒ String
included
from FatCore::Date
Format date in
MM/DD/YYYYform, as typical for the short American form. -
#eng ⇒ String
included
from FatCore::Date
Format as an English string, like
'January 12, 2016'. -
#iso ⇒ String
included
from FatCore::Date
Format as an ISO string of the form
YYYY-MM-DD. -
#num ⇒ String
included
from FatCore::Date
Format as an all-numeric string of the form
YYYYMMDD. -
#org ⇒ String
included
from FatCore::Date
Format as an inactive Org date timestamp of the form
[YYYY-MM-DD <dow>](see Emacs org-mode). -
#tex_quote ⇒ String
included
from FatCore::Date
Format date to TeX documents as ISO strings.
Queries collapse
-
#beginning_of_bimonth? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a calendar bi-monthly period, i.e., the beginning of an odd-numbered month.
-
#beginning_of_biweek? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a commercial bi-week, i.e., on /Monday/ in a commercial week that is an odd-numbered week.
-
#beginning_of_half? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a half-year.
-
#beginning_of_month? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a calendar month.
-
#beginning_of_quarter? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a calendar quarter.
-
#beginning_of_semimonth? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a calendar semi-monthly period, i.e., on the 1st or 15th of a month.
-
#beginning_of_week? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a commercial week, i.e., on /Monday/ in a commercial week.
-
#beginning_of_year? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a year.
-
#easter? ⇒ Boolean
included
from FatCore::Date
Return whether this date is Easter Sunday for the year in which it falls according to the Western Church.
-
#end_of_bimonth? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a calendar bi-monthly period, i.e., the end of an even-numbered month.
-
#end_of_biweek? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a commercial bi-week, i.e., on /Sunday/ in a commercial week that is an even-numbered week.
-
#end_of_half? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a half-year.
-
#end_of_month? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a calendar month.
-
#end_of_quarter? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a calendar quarter.
-
#end_of_semimonth? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a calendar semi-monthly period, i.e., on the 14th or the last day of a month.
-
#end_of_week? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the first day of a commercial week, i.e., on /Sunday/ in a commercial week.
-
#end_of_year? ⇒ Boolean
included
from FatCore::Date
Return whether the date falls on the last day of a year.
-
#half ⇒ 1, 2
included
from FatCore::Date
Self's calendar "half" by analogy to calendar quarters: 1 or 2, depending on whether the date falls in the first or second half of the calendar year.
-
#nth_wday_in_month?(n, wday, month) ⇒ Boolean
included
from FatCore::Date
Return whether this date is the
nth weekdaywdayof the givenmonthin this date's year. -
#quarter ⇒ 1, ...
included
from FatCore::Date
Self's calendar quarter: 1, 2, 3, or 4, depending on which calendar quarter the date falls in.
-
#weekday? ⇒ Boolean
included
from FatCore::Date
Does self fall on a weekday?.
-
#weekend? ⇒ Boolean
included
from FatCore::Date
Does self fall on a weekend?.
-
#within_6mos_of?(d) ⇒ Boolean
included
from FatCore::Date
Return whether this date falls within a period of less than six months from the date
dusing the *Stella v.
Class Method Details
.days_in_month(y, m) ⇒ Object Originally defined in module FatCore::Date::ClassMethods
.easter(year) ⇒ ::Date Originally defined in module FatCore::Date::ClassMethods
Return the date of Easter for the Western Church in the given year.
.nth_wday_in_year_month(n, wday, year, month) ⇒ Object Originally defined in module FatCore::Date::ClassMethods
Return the nth weekday in the given month. If n is negative, count from last day of month.
.parse_american(str) ⇒ ::Date Originally defined in module FatCore::Date::ClassMethods
Convert a string +str+ with an American style date into a ::Date object
An American style date is of the form MM/DD/YYYY, that is it places the
month first, then the day of the month, and finally the year. The European
convention is typically to place the day of the month first, DD/MM/YYYY.
A date found in the wild can be ambiguous, e.g. 3/5/2014, but a date
string known to be using the American convention can be parsed using this
method. Both the month and the day can be a single digit. The year can be
either 2 or 4 digits, and if given as 2 digits, it adds 2000 to it to give
the year.
.parse_spec(spec, spec_type = :from) ⇒ ::Date Originally defined in module FatCore::Date::ClassMethods
Convert a 'period spec' spec to a ::Date. A date spec is a short-hand way of
specifying a calendar period either absolutely or relative to the computer
clock. This method returns the first date of that period, when spec_type
is set to :from, the default, and returns the last date of the period
when spec_type is :to.
There are a number of forms the spec can take. In each case,
::Date.parse_spec returns the first date in the period if spec_type is
:from and the last date in the period if spec_type is :to:
YYYYis the whole yearYYYY,YYYY-1HorYYYY-H1is the first calendar half in yearYYYY,H2or2His the second calendar half of the current year,YYYY-3QorYYYY-Q3is the third calendar quarter of year YYYY,Q3or3Qis the third calendar quarter in the current year,YYYY-04orYYYY-4is April, the fourth month of yearYYYY,4-12or04-12is the 12th of April in the current year,4or04is April in the current year,YYYY-W32orYYYY-32Wis the 32nd week in year YYYY,W32or32Wis the 32nd week in the current year,YYYY-MM-DDa particular date, so:fromand:toreturn the same date,this_<chunk>where<chunk>is one ofyear,half,quarter,bimonth,month,semimonth,biweek,week, orday, the corresponding calendar period in which the current date falls,last_<chunk>where<chunk>is one ofyear,half,quarter,bimonth,month,semimonth,biweek,week, orday, the corresponding calendar period immediately before the one in which the current date falls,todayis the same asthis_day,yesterdayis the same aslast_day,foreveris the period from ::Date::BOT to ::Date::EOT, essentially all dates of commercial interest, andnevercauses the method to return nil.
In all of the above example specs, letter used for calendar chunks, W,
Q, and H can be written in lower case as well. Also, you can use /
to separate date components instead of -.
Instance Method Details
#add_chunk(chunk, n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is n chunks later than self.
#add_fed_workdays(n) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is n federal workdays after or before (if n < 0) this date.
#add_nyse_workdays(n) ⇒ ::Date Also known as: add_trading_days Originally defined in module FatCore::Date
Return the date that is n NYSE trading days after or before (if n < 0) this date.
#american ⇒ String Originally defined in module FatCore::Date
Format date in MM/DD/YYYY form, as typical for the short American
form.
#beginning_of_bimonth ⇒ ::Date Originally defined in module FatCore::Date
The date that is the first day of the bimonth in which self falls. A 'bimonth' is a two-month calendar period beginning on the first day of the odd-numbered months. E.g., 2014-01-01 to 2014-02-28 is the first bimonth of 2014.
#beginning_of_bimonth? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a calendar bi-monthly period, i.e., the beginning of an odd-numbered month.
#beginning_of_biweek ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is the first day of the commercial biweek in which self falls. A biweek is a period of two commercial weeks starting with an odd-numbered week and with each week starting in Monday and ending on Sunday.
#beginning_of_biweek? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a commercial bi-week, i.e., on /Monday/ in a commercial week that is an odd-numbered week. From ::Date: "The calendar week is a seven day period within a calendar year, starting on a Monday and identified by its ordinal number within the year; the first calendar week of the year is the one that includes the first Thursday of that year. In the Gregorian calendar, this is equivalent to the week which includes January 4."
#beginning_of_chunk(chunk) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is the beginning of the +chunk+ in which this date falls.
#beginning_of_half ⇒ ::Date Originally defined in module FatCore::Date
The date that is the first day of the half-year in which self falls.
#beginning_of_half? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a half-year.
#beginning_of_month? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a calendar month.
#beginning_of_quarter? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a calendar quarter.
#beginning_of_semimonth ⇒ ::Date Originally defined in module FatCore::Date
The date that is the first day of the semimonth in which self falls. A semimonth is a calendar period beginning on the 1st or 16th of each month and ending on the 15th or last day of the month respectively. So each year has exactly 24 semimonths.
#beginning_of_semimonth? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a calendar semi-monthly period, i.e., on the 1st or 15th of a month.
#beginning_of_week? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a commercial week, i.e., on /Monday/ in a commercial week. From ::Date: "The calendar week is a seven day period within a calendar year, starting on a Monday and identified by its ordinal number within the year; the first calendar week of the year is the one that includes the first Thursday of that year. In the Gregorian calendar, this is equivalent to the week which includes January 4."
#beginning_of_year? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a year.
#easter? ⇒ Boolean Originally defined in module FatCore::Date
Return whether this date is Easter Sunday for the year in which it falls according to the Western Church. A few holidays key off this date as "moveable feasts."
#easter_this_year ⇒ ::Date Originally defined in module FatCore::Date
Return the date for Easter in the Western Church for the year in which this date falls.
#end_of_bimonth ⇒ ::Date Originally defined in module FatCore::Date
The date that is the last day of the bimonth in which self falls. A 'bimonth' is a two-month calendar period beginning on the first day of the odd-numbered months. E.g., 2014-01-01 to 2014-02-28 is the first bimonth of 2014.
#end_of_bimonth? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a calendar bi-monthly period, i.e., the end of an even-numbered month.
#end_of_biweek ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is the last day of the commercial biweek in which self falls. A biweek is a period of two commercial weeks starting with an odd-numbered week and with each week starting in Monday and ending on Sunday. So this will always return a Sunday in an even-numbered week.
#end_of_biweek? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a commercial bi-week, i.e., on /Sunday/ in a commercial week that is an even-numbered week. From ::Date: "The calendar week is a seven day period within a calendar year, starting on a Monday and identified by its ordinal number within the year; the first calendar week of the year is the one that includes the first Thursday of that year. In the Gregorian calendar, this is equivalent to the week which includes January 4."
#end_of_chunk(chunk) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is the end of the +chunk+ in which this date falls.
#end_of_half ⇒ ::Date Originally defined in module FatCore::Date
The date that is the last day of the half-year in which self falls.
#end_of_half? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a half-year.
#end_of_month? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a calendar month.
#end_of_quarter? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a calendar quarter.
#end_of_semimonth ⇒ ::Date Originally defined in module FatCore::Date
The date that is the last day of the semimonth in which self falls. A semimonth is a calendar period beginning on the 1st or 16th of each month and ending on the 15th or last day of the month respectively. So each year has exactly 24 semimonths.
#end_of_semimonth? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a calendar semi-monthly period, i.e., on the 14th or the last day of a month.
#end_of_week? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the first day of a commercial week, i.e., on /Sunday/ in a commercial week. From ::Date: "The calendar week is a seven day period within a calendar year, starting on a Monday and identified by its ordinal number within the year; the first calendar week of the year is the one that includes the first Thursday of that year. In the Gregorian calendar, this is equivalent to the week which includes January 4."
#end_of_year? ⇒ Boolean Originally defined in module FatCore::Date
Return whether the date falls on the last day of a year.
#eng ⇒ String Originally defined in module FatCore::Date
Format as an English string, like 'January 12, 2016'
#fed_holiday? ⇒ Boolean Originally defined in module FatCore::Date
Return whether this date is a United States federal holiday.
Calculations for Federal holidays are based on 5 USC 6103, include all weekends, Presidential funerals, and holidays decreed executive orders.
#fed_workday? ⇒ Boolean Originally defined in module FatCore::Date
Return whether this date is a date on which the US federal government is open for business. It is the opposite of #fed_holiday?
#half ⇒ 1, 2 Originally defined in module FatCore::Date
Self's calendar "half" by analogy to calendar quarters: 1 or 2, depending on whether the date falls in the first or second half of the calendar year.
#iso ⇒ String Originally defined in module FatCore::Date
Format as an ISO string of the form YYYY-MM-DD.
#next_bimonth(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ calendar bimonths after this date, where a calendar bimonth is a period of 2 months.
#next_biweek(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ biweeks after this date where each biweek is 14 days.
#next_fed_workday ⇒ ::Date Originally defined in module FatCore::Date
Return the next federal workday after this date. The date returned is always a date at least one day after this date, never this date.
#next_half(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ calendar halves after this date, where a calendar half is a period of 6 months.
#next_nyse_workday ⇒ ::Date Also known as: next_trading_day Originally defined in module FatCore::Date
Return the next NYSE trading day after this date. The date returned is always a date at least one day after this date, never this date.
#next_quarter(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ calendar quarters after this date, where a calendar quarter is a period of 3 months.
#next_semimonth(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ semimonths after this date. Each semimonth begins on the 1st or 16th of the month, and advancing one semimonth from the first half of a month means to go as far past the 16th as the current date is past the 1st; advancing one semimonth from the second half of a month means to go as far into the next month past the 1st as the current date is past the 16th, but never past the 15th of the next month.
#next_until_fed_workday ⇒ ::Date Originally defined in module FatCore::Date
Return this date if its a federal workday, otherwise skip forward to the first later federal workday.
#next_until_trading_day ⇒ ::Date Originally defined in module FatCore::Date
Return this date if its a trading day, otherwise skip forward to the first later trading day.
#next_week(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ weeks after this date where each week is 7 days. This is different from the #next_week method in active_support, which goes to the first day of the week in the next week and does not take an argument +n+ to go multiple weeks.
#nth_wday_in_month?(n, wday, month) ⇒ Boolean Originally defined in module FatCore::Date
Return whether this date is the nth weekday wday of the given month in
this date's year.
#num ⇒ String Originally defined in module FatCore::Date
Format as an all-numeric string of the form YYYYMMDD
#nyse_holiday? ⇒ Boolean Originally defined in module FatCore::Date
Returns whether this date is one on which the NYSE was or is expected to be closed for business.
Calculations for NYSE holidays are from Rule 51 and supplementary materials for the Rules of the New York Stock Exchange, Inc.
- General Rule 1: if a regular holiday falls on Saturday, observe it on the preceding Friday.
- General Rule 2: if a regular holiday falls on Sunday, observe it on the following Monday.
These are the regular holidays:
- New Year's Day, January 1.
- Birthday of Martin Luther King, Jr., the third Monday in January.
- Washington's Birthday, the third Monday in February.
- Good Friday Friday before Easter Sunday. NOTE: this is not a fed holiday
- Memorial Day, the last Monday in May.
- Independence Day, July 4.
- Labor Day, the first Monday in September.
- Thanksgiving Day, the fourth Thursday in November.
- Christmas Day, December 25.
Columbus and Veterans days not observed.
In addition, there have been several days on which the exchange has been closed for special events such as Presidential funerals, the 9-11 attacks, the paper-work crisis in the 1960's, hurricanes, etc. All of these are considered holidays for purposes of this method.
In addition, every weekend is considered a holiday.
#nyse_workday? ⇒ Boolean Also known as: trading_day? Originally defined in module FatCore::Date
Return whether the NYSE is open for trading on this date.
#org ⇒ String Originally defined in module FatCore::Date
Format as an inactive Org date timestamp of the form [YYYY-MM-DD <dow>]
(see Emacs org-mode)
#pred ⇒ ::Date Originally defined in module FatCore::Date
Predecessor of self, opposite of #succ.
#prior_bimonth(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ calendar bimonths before this date, where a calendar bimonth is a period of 2 months.
#prior_biweek(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ biweeks before this date where each biweek is 14 days.
#prior_day(n) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ weeks before this date where each week is 7 days.
#prior_fed_workday ⇒ ::Date Originally defined in module FatCore::Date
Return the last federal workday before this date. The date returned is always a date at least one day before this date, never this date.
#prior_half(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ calendar halves before this date, where a calendar half is a period of 6 months.
#prior_nyse_workday ⇒ ::Date Also known as: prior_trading_day Originally defined in module FatCore::Date
Return the last NYSE trading day before this date. The date returned is always a date at least one day before this date, never this date.
#prior_quarter(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ calendar quarters before this date, where a calendar quarter is a period of 3 months.
#prior_semimonth(n = 1) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ semimonths before this date. Each semimonth begins on the 1st or 15th of the month, and retreating one semimonth from the first half of a month means to go as far past the 15th of the prior month as the current date is past the 1st; retreating one semimonth from the second half of a month means to go as far past the 1st of the current month as the current date is past the 15th, but never past the 14th of the the current month.
#prior_until_fed_workday ⇒ Object Originally defined in module FatCore::Date
Return this if its a federal workday, otherwise skip back to the first prior federal workday.
#prior_until_trading_day ⇒ ::Date Originally defined in module FatCore::Date
Return this date if its a trading day, otherwise skip back to the first prior trading day.
#prior_week(n) ⇒ ::Date Originally defined in module FatCore::Date
Return the date that is +n+ weeks before this date where each week is 7 days.
#quarter ⇒ 1, ... Originally defined in module FatCore::Date
Self's calendar quarter: 1, 2, 3, or 4, depending on which calendar quarter the date falls in.
#tex_quote ⇒ String Originally defined in module FatCore::Date
Format date to TeX documents as ISO strings
#weekday? ⇒ Boolean Originally defined in module FatCore::Date
Does self fall on a weekday?
#weekend? ⇒ Boolean Originally defined in module FatCore::Date
Does self fall on a weekend?
#within_6mos_of?(d) ⇒ Boolean Originally defined in module FatCore::Date
Return whether this date falls within a period of less than six months
from the date d using the Stella v. Graham Page Motors convention that
"less" than six months is true only if this date falls within the range of
dates 2 days after date six months before and 2 days before the date six
months after the date d.