Momentjs-durations

提供:Dev Guides
移動先:案内検索

MomentJS-期間

MomentJSは、指定されたユニットの時間の長さを処理する期間と呼ばれる重要な機能を提供します。 この章では、これについて詳しく学習します。

期間で利用可能なメソッド

次の表は、モーメントデュレーションで使用されるさまざまなユニットのデュレーションで使用可能なメソッドを示しています-

方法

構文

リンク:/momentjs/momentjs_creating [作成]

moment.duration(Number、String);

moment.duration(数値);

moment.duration(Object);

moment.duration(String);

リンク:/momentjs/momentjs_clone [クローン]

moment.duration()。clone();

リンク:/momentjs/momentjs_humanize [Humanize]

moment.duration()。humanize();

リンク:/momentjs/momentjs_milliseconds [ミリ秒]

moment.duration()。milliseconds();

moment.duration()。asMilliseconds();

リンク:/momentjs/momentjs_seconds [秒]

moment.duration()。seconds();

moment.duration()。asSeconds();

リンク:/momentjs/momentjs_minutes [分]

moment.duration()。minutes();

moment.duration()。asMinutes();

リンク:/momentjs/momentjs_hours [時間]

moment.duration()。hours();

moment.duration()。asHours();

リンク:/momentjs/momentjs_days [日]

moment.duration()。days();

moment.duration()。asDays();

リンク:/momentjs/momentjs_weeks [週]

moment.duration()。weeks();

moment.duration()。asWeeks();

リンク:/momentjs/momentjs_months [月]

moment.duration()。months();

moment.duration()。asMonths();

moment.duration()。years();

moment.duration()。asYears();

リンク:/momentjs/momentjs_add_time [時間を追加]

moment.duration()。add(Number、String);

moment.duration()。add(Number);

moment.duration()。add(Duration);

moment.duration()。add(Object);

リンク:/momentjs/momentjs_subtract_time [減算時間]

moment.duration()。subtract(Number、String);

moment.duration()。subtract(Number);

moment.duration()。subtract(Duration);

moment.duration()。subtract(Object);

リンク:/momentjs/momentjs_using_duration_with_diff [Diffでの期間の使用]

var duration = moment.duration(x.diff(y))

リンク:/momentjs/momentjs_as_unit_of_time [時間の単位として]

moment.duration()。as(String);

リンク:/momentjs/momentjs_get_unit_of_time [時間の単位を取得]

duration.get( 'hours');

duration.get( 'minutes');

duration.get( 'seconds');

duration.get( 'milliseconds');

リンク:/momentjs/momentjs_duration_as_json [JSONとして]

moment.duration()。toJSON();

リンク:/momentjs/momentjs_is_duration [Is a Duration]

moment.isDuration(obj);

リンク:/momentjs/momentjs_duration_as_iso_8601_string [ISO 8601文字列として]

moment.duration()。toISOString();

リンク:/momentjs/momentjs_locale [ロケール]

moment.duration()。locale();

moment.duration()。locale(String);