自動化で日付と時刻をフォーマットして調整する

さまざまな日付変数によって、日付を移動または日付の表示方法を変更できます。たとえば、{cardduedate} のような変数の値を使用する際は、値を数日または数週間シフトまたは GMT などの別のタイムゾーンで表示することをお勧めします。

You can use all of the operations described in this article with the date and due date variables and with custom field variables (in custom fields of the "Date" type).

日付変数の値への加算または減算

日付変数の次の値を加/減算できます。

時間

説明

min

{time+30min}

指定時刻から 30 分後

h

{cardduedate-2h}

カード期限の 2 時間前

d

{date-7d}

7 日前の日付

営業日

wd

{date+5wd}

日付から 5 営業日後

W

{{%Start Date}+6w}

カスタム フィールド {{%Start Date}} の日付から 6 週間後。

これからは

{{%Start Date}+1y}

カスタム フィールド {{%Start Date}} の日付から 1 年後。

: 営業日の値で {date+1wd} は翌営業日ではなく、営業日が終わった翌日のことを指します。この微妙な違いは、日付が週末に当たる場合にのみ重要です。たとえば「土曜日 +1 営業日」は火曜日になります。翌営業日を取得するには {datelong+0wd} を、前営業日を取得するには {datelong-0wd} を使用します。

日付値の一部を変更

週の日付、月の日付などを使用して日付値の部分を変更、または両方の調整操作を組み合わせられます。

週の曜日を変更する

週の曜日を変更するには、wd 値に続けて平日の日数を使用します。

: 曜日を変更する際に、wd営業日ではなく曜日を表します。 

例:

  • {date=0wd} は今週の日曜日です。

  • {date=1wd} は今週の月曜日です。

月の日付を変更する

月の日数を変更するには、d 値に続けて日数を使用します。 

:

  • {date=1d} は今月の最初の日です。

  • {date=15d} は今月の 15 日目です。

  • {date=31d} は月の長さにかかわらず今月の最終日です。

週と日の調整を組み合わせる

日付を調整するには、週の曜日 (wd) と月の日数 (d) の両方を変更できます。

:  

  • {date-1w=1wd} は先週の月曜日です。

  • {date+3m=31d} は、今から 3 か月後の月末日です。

タイムゾーンの変更

自動化は、PST、EDT、GMT などのタイムゾーン仕様の一般的な略称をサポートしています。 

You can specify a short timezone name such as {{%Start Date}@HKT} (Hong Kong time) or the full timezone name like {date@Australia/Sydney} . You can find a full list of timezones on Wikipedia.

また、タイムゾーンの変更を調整操作と組み合わせられます。たとえば、{cardduedate+5wd@PST} は現在から 5 営業日後の太平洋標準時の日付です。

日付値のフォーマット

The value of the date can also be formatted by specifying a pattern after ~. The format specification comes from the moment.js library.

パターン {date~dddd, MMMM Do YYYY, h:mm:ss a} では、日付の形式 Thursday, May 31st 2018, 12:00:00 am のようになります。


The moment.js library formatting can be particularly useful if you need to generate list or card names. 

when custom field "Start Date" is set by anyone, move the card to list "Week {{%Start Date}=1wd~MMM D} - {{%Start Date}=5wd~MMM D}" 

この自動化は、カスタム フィールド [開始日] の値に応じてカードをリストに自動で移動します。(存在しない場合は) リストが自動で作成されて名前は「Week May 28th - Jun 1st」のようにフォーマットされます。

ネストされたカスタム フィールド変数 (詳細)

You can use the value of a custom field to specify the parameters for date arithmetic or formatting operations. For example: {{%Start Date}+wd@.

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。