Skip to content

Commit

Permalink
[カスタムフィールドの日付に応じて、チケットリストの背景色を変更] 過去と未来で色を変えるように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
onozaty committed Aug 11, 2023
1 parent 7dfff8f commit 6b7f505
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
Change the background color of the issue list according to the date of the custom field.
カスタムフィールドの日付に応じて、チケットリストの背景色を変更します。

In this example, if the date in custom field ID:1 is in the future, the background color is pink.
この例では、カスタムフィールドID:1 の日付が未来の場合、背景色をピンクにします。
This example changes the background color depending on the date of the custom field ID:1.
この例では、カスタムフィールドID:1の日付によって背景色を変えています。

* Pink for future
未来はピンク
* Yellow for past
黄色は過去

## Setting

Expand Down Expand Up @@ -37,20 +42,20 @@ $(function() {
const now = new Date();
const nowDate = new Date(now.getFullYear(), now.getMonth(), now.getDate());

$('table.issues td.cf_1')
.filter(function() {
const str = $(this).text();
if (str === '') {
return false;
}

const date = new Date(str);
return date > nowDate;
})
.parent()
.css({
'background-color': 'pink'
});
$('table.issues td.cf_1').each(function() {
const target = $(this);
const str = target.text();
if (str === '') {
return;
}

const date = new Date(str);
if (date > nowDate) {
target.parent().css({ 'background-color': 'pink' });
} else if (date < nowDate) {
target.parent().css({ 'background-color': 'yellow' });
}
});
});
```

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b7f505

Please sign in to comment.