...
...
...
Описание: Возвращает true, если текущая дата позже переданной.
Принимает:объект SimpleDateTime.
Возвращает: bool.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
var second_simple_date_time = new SimpleDateTime("2018-01-01 08:00:00");
let result = first_simple_date_time.after(second_simple_date_time);
ss.info(result) // true
...
Описание: Возвращает true, если текущая дата раньше переданной.
Принимает:объект SimpleDateTime.
Возвращает: bool.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
var second_simple_date_time = new SimpleDateTime("2018-01-01 08:00:00");
let result = first_simple_date_time.before(second_simple_date_time);
ss.info(result) // false
...
Описание: Возвращает 0, если переданная и текущая дата равны, 1 - если текущая дата больше и -1, если текущая дата меньше.
Принимает:объект SimpleDateTime.
Возвращает: null|int.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
var second_simple_date_time = new SimpleDateTime("2018-01-01 08:00:00");
var third_simple_date_time = new SimpleDateTime("2018-01-01 08:00:00");
ss.info( first_simple_date_time.compareTo(second_simple_date_time) ); // 1
ss.info( second_simple_date_time.compareTo(first_simple_date_time) ); // -1
ss.info( third_simple_date_time.compareTo(second_simple_date_time ) ); // 0
...
Описание: Проверяет, равна ли переданная дата дате текущего объекта.
Принимает:объект SimpleDateTime.
Возвращает: bool.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
var second_simple_date_time = new SimpleDateTime("2018-01-01 08:00:00");
var third_simple_date_time = new SimpleDateTime("2018-01-01 08:00:00");
ss.info( first_simple_date_time.equals(second_simple_date_time) ); // 0
ss.info( third_simple_date_time.equals(second_simple_date_time ) ); // 1
...
Описание: Возвращает день недели , сохраненный объектом SimpleDateTime, в пользовательской тайм-зоне.
Принимает:Ничего.
Возвращает:string.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
ss.info( first_simple_date_time.getDayOfWeekLocalTime() ); // Tue
...
Описание: Возвращает день недели , сохраненный объектом SimpleDateTime, в дефолтной тайм-зоне.
Принимает:Ничего.
Возвращает:string.
Exaple:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
ss.info( first_simple_date_time.getDayOfWeekUTC() );
...
Описание: Возвращает день месяца в пользовательской тайм-зоне.
Принимает:Ничего.
Возвращает:int.
Exaple:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
ss.info( first_simple_date_time.getDayOfMonthLocalTime() ); // 1
...
Описание: Возвращает день месяца в UTC тайм-зоне
Принимает:Ничего.
Возвращает:int.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
ss.info( first_simple_date_time.getDayOfMonthUTC() );
...
Описание: Возвращает количество дней в месяце в пользовательской тайм-зоне
Принимает:Ничего.
Возвращает:int.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
ss.info( first_simple_date_time.getDaysInMonthLocalTime() ); // 31
...
Описание: Возвращает количество дней в месяце в дефолтной тайм-зоне
Принимает:Ничего.
Возвращает:int.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
ss.info( first_simple_date_time.getDaysInMonthUTC() );
...
Описание: Возвращает сообщение об ошибке в случае неверного формата DateTime.
Принимает:Ничего.
Возвращает:string.
Example:
var first_simple_date_time = new SimpleDateTime("2019-zz-01 08:00:00");
ss.info( first_simple_date_time.getErrorMsg() ) ; //The parsed date or time was invalid!
...
Описание:Валидация корректной даты и времени.
Принимает:Ничего.
Возвращает:bool.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
first_simple_date_time.setDisplayValue("2011-aa-01 00:00:00");
ss.info( first_simple_date_time.isValid() ) ; // false
...
Описание:Устанавливает DateTime с учетом пользовательской тайм-зоны.
Принимает:dateTime - string, опционально: format - string (по умолчанию - null).
Возвращает: Ничего.
Example:
var first_simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
first_simple_date_time.setDisplayValue("2020-01-01 12:00:00");
ss.info( first_simple_date_time.getValue() );
...
Описание: Устанавливает дату и время объекта SimpleDateTime.
Принимает:
...
...
...
...
...
...
...
...
...
...
...
Описание:Отнимает от текущего времени либо возвращает разницу между переданными объектами SimpleDateTime.
Принимает:
- SimpleDateTime Object
- SimpleTime Object
- Number milliseconds
Возвращает: объект SimpleDuration
Example:
var simple_date_time = new SimpleDateTime("2019-01-01 08:00:00");
var simple_time = new SimpleTime();
simple_time.setValue("00:00:20");
simple_date_time.subtract(simple_time);
...