Forum Discussion

BuildPro's avatar
BuildPro
Qrew Captain
3 years ago

Colorize words

I am trying to create a field where the words are colorized based on day of week.

FIELD NAME: [SKIM DATE COLOR] equals FIELD NAME: [SKIM DATE DAY]
FIELD TYPE: RICH TEXT FORMULA

Then, I want the this date field to have the words (for example(Friday, May 13)) to be colored based on the day of the week.

------------------------------
BuildPro
------------------------------
  • Colourize the words or the background shading?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • BuildPro's avatar
      BuildPro
      Qrew Captain
      The words, please

      ------------------------------
      BuildPro
      ------------------------------
  • try this

    var date MyDate = [SKIM DATE DAY];

    var text DayName = Case(DayOfWeek($MyDate),
    0,"Sunday",
    1,"Monday",
    2,"Tuesday",
    3,"Wednesday",
    4,"Thursday",
    5,"Friday",
    6,"Saturday");



    var text DateWords =
    $DayName
    & ", "
    &Case(Month($MyDate),
    1,"January",
    2,"February",
    3,"March",
    4,"April",
    5,"May",
    6,"June",
    7,"July",
    8,"August",
    9,"September",
    10,"October",
    11,"November",
    12,"December")
    & " "
    &ToText(Day($MyDate));

    var text Color = 
    Case(DayofWeek([SKIM DATE DAY]),
    0, "red",
    1, "orange",
    2, "purple",
    3, "blue",
    4, "black",
    5, "green",
    6, "brown");

    "<font color=" & $Color & ">" & $DateWords



    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • BuildPro's avatar
      BuildPro
      Qrew Captain


      var date MyDate = [SKIM DATE DAY];

      var text DayName = Case(DayOfWeek($MyDate),
      0,"Sunday",
      1,"Monday",
      2,"Tuesday",
      3,"Wednesday",
      4,"Thursday",
      5,"Friday",
      6,"Saturday")
      &""

      var text Color =
      Case(DayofWeek([SKIM DATE DAY]),
      0, "red",
      1, "orange",
      2, "purple",
      3, "blue",
      4, "black",
      5, "green",
      6, "brown");

      &ToText(Day($MyDate));

      "<font color=" & $Color & ">" & $DateWords

      ------------------------------
      BuildPro
      ------------------------------
      • BuildPro's avatar
        BuildPro
        Qrew Captain
        Got It to partially work...but is returning this



        var date MyDate = [SKIM DATE DAY];

        var text DayName = Case(DayOfWeek($MyDate),
        0,"Sunday",
        1,"Monday",
        2,"Tuesday",
        3,"Wednesday",
        4,"Thursday",
        5,"Friday",
        6,"Saturday")
        &""
        &ToText(Day($MyDate));

        var text Color =
        Case(DayOfWeek([SKIM DATE DAY]),
        0, "red",
        1, "orange",
        2, "purple",
        3, "blue",
        4, "black",
        5, "green",
        6, "brown");



        "<font color=" & $Color & ">" & $MyDate

        ------------------------------
        BuildPro
        ------------------------------