How to get Current month dates in a List?

Certified Senior Developer

I want to filter out current month dates in a list 

"9/9/2022",

"9/8/2021",

"10/7/2022",

"9/29/2021",

"10/24/2022",

"7/19/2022",

"5/16/2022",

"8/15/2022",

"9/14/2022",

"10/14/2021",

"1/13/2022"

Expected result: {"10/7/2022","10/24/2022"}

Can somebody help me with this ?

      Discussion posts and replies are publicly visible

    Parents
    • You can also try this:

      a!localVariables(
        local!dates: {
          "9/9/2022",
          "9/8/2021",
          "10/7/2022",
          "9/29/2021",
          "10/24/2022",
          "7/19/2022",
          "5/16/2022",
          "8/15/2022",
          "9/14/2022",
          "10/14/2021",
          "1/13/2022"
        },
        a!forEach(
          items: local!dates,
          expression: if(
            and(
              month(fv!item) = month(today()),
              year(fv!item) = year(today())
            ),
            fv!item,
            {}
          )
        )
      )

    Reply
    • You can also try this:

      a!localVariables(
        local!dates: {
          "9/9/2022",
          "9/8/2021",
          "10/7/2022",
          "9/29/2021",
          "10/24/2022",
          "7/19/2022",
          "5/16/2022",
          "8/15/2022",
          "9/14/2022",
          "10/14/2021",
          "1/13/2022"
        },
        a!forEach(
          items: local!dates,
          expression: if(
            and(
              month(fv!item) = month(today()),
              year(fv!item) = year(today())
            ),
            fv!item,
            {}
          )
        )
      )

    Children
    No Data