How to select date from date picker using VBA selenium? - vba

I want to choose a date
if I select the 1st, then automatically click on the 1st
this is my code
driver.FindElementByXPath("//button[contains(text(),'1')]").Click ' not working
driver.FindElementByXPath("//*[#class='btn-icon date-picker-month-date' and text()='1']").Click ' not working

Related

Identify Week Number, Month Number, Year from DatePicker control in VBA userform

I have been trying to make my user form work by getting codes everywhere. I don't have any experience in VBA so the code that I have are patches from different sources.
I have a datepicker control in my user form and i'd like to get the corresponding week number, month number and year based on the date that is chosen from the datepicker control box and populate the corresponding textboxes for each
datepicker and textbox dependencies.
To get the week number use the below. The third and fourth arguments allow you to dictate the first day/first week of the year.
TextBoxWeek.Value = DatePart("ww", TextBoxDatePicker.Value, vbMonday, vbFirstJan1 )
Month:
TextBoxMonth.Value = format(TextBoxDatePicker.value,"mm")
Year: (you can also use "yy" to get the shorthand date eg. '17' rather than '2017')
TextBoxYear.Value = format(TextBoxDatePicker.value, "yyyy")

Compare two columns as date

I have two columns in excel like column send out date & column received date. I want to compare each "Send Out Date & Received Date", if the difference is longer than 3 working day exclude Sunday then turn the "received date cells" will RED color.
[Send Out Date] [Received Date]
26-May 28-May
26-May **29-May**
In excel 2010:
select the range you want to format (e.g. B2:B3 in your example)
in home tab select conditional formatting - new rule - use a formula to determine which cells to format.
type this: =NETWORKDAYS.INTL(A2,B2,11)>3
click format and set the formatting you need.

Linked Date Pickers

I am using the linked date time picker given at http://eonasdan.github.io/bootstrap-datetimepicker/
My problem is with picking up the date and time for an intra day event.
For example in the first text area select this date and time :02/26/2015 8:48 AM
Now attempt to select this date and time in the second text area:02/26/2015 9:20 AM which does not happen.
The problem can be simulated on the above link.

Excel Macro to separate date into year month week

I am having a really difficult time with this excel table and was trying to use VBA as well as Excel functions to get the date formatted into Year, Month, Week but I keep running into issues.
I have the below input:
The reason Column1 looks so odd is because I was TRYING to use =MONTH([Date]) but it looks all weird and doesn't sort into the month or week it is supposed to.
Below is the expected outcome if everything were to work.
So using the Date column I want to generate 3 columns: Year, Month, Week
Any idea if I am doing something wrong in excel or if there is an easy way to do this in VBA?
with the date in A2 , in E2 enter:
=A2 and format as "yyyy"
In F2 enter:
=A2 and format as "mm-mmmm"
In G2 enter:
="Week " & ROUNDUP(DAY(A2)/7,0)
Not sure where the issue is but the following formulae will give you year, month, and day. Where a1 contains a date
=year(a1)
=month(a1)
=day(a1)
Of course if you want the month to show the month in words rather than a number you can format the cell as custom and then mmm
You are using the right formula the only thing amiss is your column formatting as it is correctly pointed out in the comments. Follow these steps to get the desired formatting
Select the column and right click Click 'Format Cell'
In the'Number' tab select 'Custom' in the category list
Enter 'mm - mmmm' as the type.
You should get '12 - December'
Formula for year: =YEAR([#Date])
Formula for month: =MONTH([#Date]) & "-" & TEXT([#Date],"mmmm")
Formula for week: ="Week " & WEEKNUM([#Date],2)-WEEKNUM(EOMONTH([#Date],-1)+1,2)+1
and use appropriate format for each column.

QlikView Problems with Listbox

I want to have a list box that shows the following:
YYYY: WeekNumber - Date
The Date part is using a Broadcast Calendar (starts on Sundays, so week 1 of 2012 is actually Monday 12/26/2011).
This needs to be conditional:
If the year selected is the current year, only show through the latest "broadcastMonday" which in this case is Week 9 (2/20/2012). Then go back all the way through the prior year to week 1 of 2011, which is actually 12/27/2010.
If the year selected is less than the current year, only show all of that year plus all of the prior year.
The following expression for the List Box is working just fine for me with respect to displaying the right information, but when I click an item in the list it doesn't select it:
=If([Year]=year(ReloadTime()),if(left(BroadcastPeriod2,4)>=[Prior Year]
and BroadcastWeekStart2<ReloadTime(),(left(BroadcastPeriod2,4) & ' : ' &
BroadCastWeek2 & '-' & date(BroadcastWeekStart2)),),if(left(BroadcastPeriod2,4)>=
[Prior Year] and left(BroadcastPeriod2,4)<=([Year]),left(BroadcastPeriod2,4) & ' : '
& BroadCastWeek2 & '-' & date(BroadcastWeekStart2),))
I think the answer is to either do it in the load (concatenating the fields) or to use a table instead of the input box.
I would try to calculate the value for the listbox in the loadscript. I had trouble comparing StartMonth values in set analysis and could come around this by pre-calculating the values at load time.
Did something similar in Qlikview aggration with conditions