cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StefWS
Helper III
Helper III

comparing only day an month

Hi all,

 

I have a date column in a sharepoint list. I want to check people's birthday and then do something with that. Eg, change the display color of the birth day to red.

 

But off course I only need the day and month. How do I write an expression to compare the day and month to todays date?

1 ACCEPTED SOLUTION

Accepted Solutions
TheRobRush
Super User
Super User

Ok so I placed a gallery in a test app just to show you how it works in a gallery, may need to edit slightly to match your needs but here goes.

 

My gallery has a items value of

CoachingDatabase

which is just a random splist i have with dates in it so chose that

 

Title box in that gallery has text value of

Text(DateValue(ThisItem.DATE),"dd/mm")

and a color value of

If(
    And(Day(ThisItem.DATE)=Day(Today()), Month(ThisItem.DATE)=Month(Today())), Red, Green)

 

which results in the following, where every date that matches today shows in red, and otherwise date is green

TheRobRush_0-1668800890100.png

 

 

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

4 REPLIES 4
TheRobRush
Super User
Super User

Can you clarify, are you wanting to change its color in sharepoint, or in powerapps. and if in powerapps how are you currently displaying your data in powerapps, control type etc

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Hi @TheRobRush . Thanks for your assistance.

 

It is a text box that displays the date like this :

Text(DateValue(gallery.Selected.SPColumnName),"dd/mm")

 

I want to show this text in a different color (in PowerApps!) when the day and month matches today's day & month.

 

The SP Column is date column without time.

 

TheRobRush
Super User
Super User

Ok so I placed a gallery in a test app just to show you how it works in a gallery, may need to edit slightly to match your needs but here goes.

 

My gallery has a items value of

CoachingDatabase

which is just a random splist i have with dates in it so chose that

 

Title box in that gallery has text value of

Text(DateValue(ThisItem.DATE),"dd/mm")

and a color value of

If(
    And(Day(ThisItem.DATE)=Day(Today()), Month(ThisItem.DATE)=Month(Today())), Red, Green)

 

which results in the following, where every date that matches today shows in red, and otherwise date is green

TheRobRush_0-1668800890100.png

 

 

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
StefWS
Helper III
Helper III

Wow @TheRobRush !! Thanks, that worked like a charm and I'm super happy with it. Glad to end my week like this!! Kudos!

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,439)