Skip to content

Change the color of the ticket list according to the date of the custom field #123

@ashrafalzyoud

Description

@ashrafalzyoud

thx for your lovely plugin
depend in examples
https://github.com/onozaty/redmine-view-customize-scripts/blob/master/examples/0032.display_warning_3days_before_due_date/example.md

https://github.com/onozaty/redmine-view-customize-scripts/blob/master/examples/0016.change_font_of_issue_list_by_custom_field/example.md

how i can change color the issue list depend in current-date with cf_1 if cf_1 type date
like if the nowdate > cf_1
color red
if nowdate< cf_1
color orange

$(function() {

  const dateCustomField = $('#issue_custom_field_values_1');     // format: date
  const now = new Date();
  const nowDate = new Date(now.getFullYear(), now.getMonth(), now.getDate());

  if (nowDate >= dateCustomField) {

 $('table.issues td.cf_1')
    .filter(function() {
      return $(this).text() == 'A';
    })
    .parent()
    .css({
      'font-weight': 'bold'
   }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions