Sha256: 560183ef7522866f48149123f8c3c67256d3e96e99c47a06a26191ce2bc50b56
Contents?: true
Size: 647 Bytes
Versions: 126
Compression:
Stored size: 647 Bytes
Contents
# frozen_string_literal: true class ReeDatetime::BeginningOfMonth include Ree::FnDSL fn :beginning_of_month do link :now link :beginning_of_day link :beginning_of_month, from: :ree_date end doc(<<~DOC) Returns a new date/time at the start of the month. If no date_time passed returns date/time at the start of the current month. date_time(optional) => Thu, 18 Jun 2015 13:00:00 beginning_of_month(date_time) # => Mon, 01 Jun 2015 00:00:00 DOC contract(Nilor[DateTime] => DateTime) def call(date_time = nil) beginning_of_day(beginning_of_month(date_time || now ).to_datetime) end end
Version data entries
126 entries across 126 versions & 1 rubygems