Skip to main content
Question

Formula Rich Text field to convert date to text and show as green


Forum|alt.badge.img+9

Good morning,

I have a formula rich text field to display a date with large green characters. I have TR1 Site Survey Date set to show the day of the week and the month as a name, but it is still just showing as a date.

I've tried adding ToText(...) but it doesn't make a difference.

I tried it here:

"<b><span style='color: green; font-size:200%'>" & ToText() & "</span>"

... and here:

ToText("<b><span style='color: green; font-size:200%'>" & & "</span>")

Once I have that figured out, I also need to find a way to convert the day and month to French. I'm sure I can figure that out, but if someone has a formula already, that would be most helpful!

Thanks in advance,

Kim




------------------------------
Kim
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+9
  • Author
  • Registered
  • April 5, 2023

Well look at that! I figured it out myself.

Probably totally clugey, but it works

I created a field for each part of the date

TR1 Site Survey Day:
If(
ToText(DayOfWeek())="0", "Sunday",
ToText(DayOfWeek())="1", "Monday",
ToText(DayOfWeek())="2", "Tuesday",
ToText(DayOfWeek())="3", "Wednesday",
ToText(DayOfWeek())="4", "Thursday",
ToText(DayOfWeek())="5", "Friday",
ToText(DayOfWeek())="6", "Saturday"
)

TR1 Site Survey Month:
If(
ToText(Month())="1", "January",
ToText(Month())="2", "February",
ToText(Month())="3", "March",
ToText(Month())="4", "April",
ToText(Month())="5", "May",
ToText(Month())="6", "June",
ToText(Month())="7", "July",
ToText(Month())="8", "August",
ToText(Month())="9", "September",
ToText(Month())="10", "October",
ToText(Month())="11", "November",
ToText(Month())="12", "December"
)

TR1 Site Survey Day of Month:
ToText(Day())

TR1 Site Survey Year:
ToText(Year())

Then I updated my formula rich text field to use the fields above

TR1 Site Survey Date BOLD:
"<b><span style='color: green; font-size:200%'>" & ToText( & " " & & " " & & " " &) & "</span>"

It's a thing of beauty!

BUT...

If anyone has an easier way to do it, I would welcome any suggestions ;)

Kim



------------------------------
Kim
------------------------------

MarkShnierYou
Forum|alt.badge.img+24

Let's start with English

var date MyDate = [TR1 Site Survey Date];

var text DayName = Case(DayOfWeek($MyDate),
0,"Sun",
1,"Mon",
2,"Tue",
3,"Wed",
4,"Thu",
5,"Fri",
6,"Sat");

var text DateWords =
List(", ", $DayName,
List("-",
Case(Month($MyDate),
1,"Jan",
2,"Feb",
3,"Mar",
4,"Apr",
5,"May",
6,"Jun",
7,"Jul",
8,"Aug",
9,"Sep",
10,"Oct",
11,"Nov",
12,"Dec"),
Right("0" & ToText(Day($MyDate)),2),
If(Year(Today())<> Year([Pickup Date]), ToText(Year($MyDate)))));


"<b><span style='color: green; font-size:200%'>" & $DateWords & "</span>"




------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------