cypress selecting dates from react-calendar - cypress

So I have this annoying issue with the date picker from react-calendar. So the current date is 28th December 2021. I want to select a date in 4 days time.
I first have a month comparitor that checks whether the month is next month. In this case it is, so it will use the skip button to select the next month. January is now shown.
I now want to select the the 3rd of January, but it would select February instead
cy.get('.react-calendar__month-view__days >')
.not('[disabled]')
.each((elem) => {
if (elem.text() === nextDate.toString()) {
elem.click();
}
});
Using the above code block it goes through each element text (which is date number) and then selects the matching number. But when it comes to having 2 of the same number displayed it fails to select the right date and chooses the following month's date
Has anyone come across a similar problem? thanks

Closing this, I should have really saw the CSS. Theres a aria-label="13 January 2022" in the selector, so I can just pass the date I want to select.
cy.get(`[aria-label="${nextDate}"]`).click()

Related

Filtering from todays date, showing past dates

I followed advice on how to filter CDS records based on dates. I thought it was working last week, but now it's showing past dates. I am using powerapps and datasource is cds and I placing this into a gallery.
The formula which have been entered into the items field:
Sort(FirstN(Filter('Course schedule',End <= DateAdd(Today(), 70)),2),End)
Right now it's showing a record where End = 26/11. A past date. Plus a date in January 2022. However I have several dates between today and January. The expected view would be to see the 2 upcoming records that are closest to today's date. And not past dates...
In this picture we see the End-field showing 26th of november and January 21st.
The first is to understand why it's showing a past date and how to remedy it.
The second, what to add to sort it by end-date.
For clarification, 'Course schedule' is the table/entity I am referring to, End is the column/field inside of it that's chosen to filter from. It's a date type field.
Many thanks!
Ok, I think I have figured it out just by trying. Not sure why though:
Sort(
Filter(
'Course schedule',
End >= DateAdd(
Today(),
1
)
),
End,
Ascending
),
2
)```

Show value from last day of the given month - SSRS Report Builder

In a Report Builder table I have to show the value from the last day of the given month, when the month is not expanded.
When the month is expanded, the dates have to show the specific value for that day.
Example is January with values 1 to 31 (same as the day numbers):
When January is expanded, it has to show value 1 on Jan 1.... value 15 on Jan 15... value 31 on Jan 31.
When contracted (and the table only show one row for January), it should show the last day's value of 31
Some months do not have values on all days, so the formula just need to take the last value of that given month
When I use the formula "Last()", then it works half of the time, while for some months, the value extracted is the 3rd or 4th last day of the month - do you know what is wrong here?
Hope above makes sense, and thanks for help.
I think I fixed it my self:
Using Last () formula
Learning how to make a sort order in my Union All dataset, so it came out in the right way
How to give points to my self?

Displaying date - three days in long format minus the year in Freemarker

looking for way to display the date in freemarker as "June 1", so long format minus the year. I also need to output the date minus 3 days. So the code that works is
${(.now?long - 259200000)?number_to_date }
but that displays the year as well (June 7, 2021)
I need to get rid of the year.
I figured it out. For anyone who is reading this in the future:
${(.now?long - 259200000)?number_to_date?string['MMMM dd']}
prints as
Current date, minus 3 days, without year. So for me rn :
June 7

PowerBi - Show last week (Monday to sunday)

I'm fairly new to powerbi.
I want to be able to use a slicer to show the last week not the last 7 days.
I know you can use de relative week, but that shows the dates from Sunday to Monday.
I've also red that it's not possible to change the slicer settings for this.
Is it possible to archiev this in another way?
This is my date table https://imgur.com/a/dCcfBAZ
You can add a column that calculates last weeks' weeknumber and compares it to the weeknumber of the date in your row. Find the weeknumber for the current datetime (NOW), subtract 1, wrap that in an IF and you get a boolean to slice with:
LastWeek = IF((WEEKNUM(NOW(),2) - 1) = YourTableName[Weeknum],true,false)
Works the same as the relative week slicer option, but with the week starting on Monday.

How to load select lists based on a datepicker selection in Oracle Apex?

I have a date picker, but I also have three select lists for Day, Month, and Year. How can I load those as soon as the date picker is used to select a date?
I've made a small example: here
I have the standard datepicker set up, i did restrict the range of years on this one (2005-2015).
The three select lists i have filled up with static lovs: days -> 1 through 31, months -> 1 through 12 buth with their name as display value, years -> 2005 through 2015.
To set their values, i created a dynamic action on the datepicker:
3 actions are required, to set the selected value of each select list. Be aware though, this causes 3 ajax calls. But the implementation is basic and doesn't require you to write javascript and ajax callbacks.
Each action is similar to this one:
Days: TO_CHAR(TO_DATE(:P24_SOME_DATE), 'DD')
Months: LTRIM(TO_CHAR(TO_DATE(:P24_SOME_DATE), 'MM'), '0')
Years: TO_CHAR(TO_DATE(:P24_SOME_DATE), 'YYYY')
Mix 'n Match to suit what you need. Hope this helps!
In Year range, just put the previous year nothing to do with Manual.

Resources