Skip to content

Latest commit

 

History

History
364 lines (122 loc) · 9.57 KB

i18n_date.md

File metadata and controls

364 lines (122 loc) · 9.57 KB

#Module i18n_date#

Copyright (c) 2010-2011 Michael Uvarov

Authors: Michael Uvarov ([email protected]).

##Data Types##

###double()##

double() = number()

###fields()##

fields() = [{i18n_date_field(), double()}]

###i18n_calendar()##

i18n_calendar() = resource()

###i18n_date()##

i18n_date() = double()

###i18n_date_field()##

i18n_date_field() = era | year | month | week_of_year | date | day_of_year | day_of_week | am_pm | hour | hour_of_day | minute | second | millisecond | zone_offset | dst_offset | day_of_week_in_month

###resource()##

resource() = <<>>

##Function Index##

add/1Append double() to the field value.
add/2
add/3
clear/2Clear the field value (values).
clear/3Clear the field value (values).
compare/3
compare/4If D1 and D2 are too close, then they are equal with the precision of Field.
difference/3
difference/4
get/1Get the value of the field or fields.
get/2
get/3
new/3Create date from fields' values (YMD).
new/4Create date from fields' values (YMD).
new/6Create date from fields' values (YMDHMS).
new/7Create date from fields' values (YMDHMS).
now/0Return the timestamp (count of milliseconds from starting of the 1970 year).
roll/1This function and add function are same, but roll will not modify more significant fields in the calendar.
roll/2
roll/3
set/1Set the value of the field or fields for now().
set/2Set the value of the field or fields for date.
set/3Set the value of the field or fields for date.

##Function Details##

###add/1##

add(Fields::fields()) -> i18n_date()



Append double() to the field value.

###add/2##

add(Date::i18n_calendar() | i18n_date(), Fields::fields()) -> i18n_date()



###add/3##

add(Cal::i18n_calendar(), Date::i18n_date(), Fields::fields()) -> i18n_date()



###clear/2##

clear(Date::i18n_date(), Fields::[i18n_date_field()]) -> i18n_date()



Clear the field value (values).

###clear/3##

clear(Cal::i18n_calendar(), Date::i18n_date(), Fields::[i18n_date_field()]) -> i18n_date()



Clear the field value (values).

###compare/3##

compare(Field::i18n_date_field(), D1::i18n_date(), D2::i18n_date()) -> boolean()



###compare/4##

compare(Cal::i18n_calendar(), Field::i18n_date_field(), D1::i18n_date(), D2::i18n_date()) -> boolean()



If D1 and D2 are too close, then they are equal with the precision of Field.

###difference/3##

difference(FromDate, ToDate, Fields) -> any()

###difference/4##

difference(Cal::i18n_calendar(), FromDate::i18n_date(), ToDate::i18n_date(), Field::[i18n_date_field()] | i18n_date_field()) -> [{i18n_date_field(), integer()}] | integer()



###get/1##

get(Fields::[i18n_date_field()] | i18n_date_field()) -> [integer()] | integer()



Get the value of the field or fields.

###get/2##

get(Date::i18n_calendar() | i18n_date(), Fields::[i18n_date_field()] | i18n_date_field()) -> [integer()] | integer()



###get/3##

get(Cal::i18n_calendar(), Date::i18n_date(), Fields::[i18n_date_field()] | i18n_date_field()) -> [integer()] | integer()



###new/3##

new(Year::integer(), Month::integer(), Day::integer()) -> i18n_date()



Create date from fields' values (YMD).

###new/4##

new(Cal::i18n_calendar(), Year::integer(), Month::integer(), Day::integer()) -> i18n_date()



Create date from fields' values (YMD).

###new/6##

new(Year::integer(), Month::integer(), Day::integer(), Hour::integer(), Minute::integer(), Second::integer()) -> i18n_date()



Create date from fields' values (YMDHMS).

###new/7##

new(Cal::i18n_calendar(), Year::integer(), Month::integer(), Day::integer(), Hour::integer(), Minute::integer(), Second::integer()) -> i18n_date()



Create date from fields' values (YMDHMS).

###now/0##

now() -> i18n_date()



Return the timestamp (count of milliseconds from starting of the 1970 year).

###roll/1##

roll(Fields::fields()) -> i18n_date()



This function and add function are same, but roll will not modify more significant fields in the calendar.

###roll/2##

roll(Date::i18n_calendar() | i18n_date(), Fields::fields()) -> i18n_date()



###roll/3##

roll(Cal::i18n_calendar(), Date::i18n_date(), Fields::fields()) -> i18n_date()



###set/1##

set(Fields::fields()) -> i18n_date()



Set the value of the field or fields for now().

###set/2##

set(Date::i18n_calendar() | i18n_date(), Fields::fields()) -> i18n_date()



Set the value of the field or fields for date.

###set/3##

set(Cal::i18n_calendar(), Date::i18n_date(), Fields::fields()) -> i18n_date()



Set the value of the field or fields for date. Take a calendar as argument.