Datepicker submit format - materialize

In the new version of materialize the new 'datepicker' seems to have lost the option for 'formatSubmit'
format: 'dd/mm/yyyy'
formatSubmit: 'yyyy-mm-dd'
You use to be able to display the date in the page in one format and submit it in another.
Anyone have a way round this?

Related

How to sendkeys "time" in time type element?

I need to pass data in time format in "time" type element in "10:00 AM" format.
I am using following code:
public static void setShift()
{
txttime.sendkeys("1030AM");
}
this is not working. what is a correct way to enter such data?
Use Following Code :
It will work it for textbox/text area control
SimpleDateFormat formatter = new SimpleDateFormat("hh:mm a");
Date date = new Date();
txttime.sendkeys(date);
For the HTML input type datetime-local handling it from selenium is not ideal. It is not the most used date time picker, and it is not supported in firefox or safari.
For chrome, the date time format shows the format set in the browser's machine.
If you haven't changed anything, I'm guessing you are getting the format shown in the guru99 tutorial.
If that is the case, then you have missed that they also have provided the solution there.
After entering the date part you need to press tab to input the time part. Which is missing from your given code.
Try this:
First, input the date
WebElement dateBox = driver.findElement(By.xpath("//form//input[#name='bdaytime']"));
dateBox.sendKeys("09252013");
Second, press tab
dateBox.sendKeys(Keys.TAB);
Last, input the time
dateBox.sendKeys("0245PM");
Note:
If your machine has different DateTime formatting then this might not work. You have to check which part of the date time senKeys can actually input then split up that part and use Keys.TAB to press tab. Then input the next part until completion.

Unable to put date in <input type="date"> field in Firefox using Selenium

I am sending date of birth to an input element using selenium, data is getting entered in Chrome and Edge but in firefox that input element has an inbuilt datepicker and I am not able to inspect that default datepicker (right click doesn't work on datePicker and couldn't find any code for it). The input element is not taking values and I can't get the html element so I'm unable to fill the field.
Can anyone help me with this?
For Firefox, the date format is yyyy-mm-dd , regardless placeholder. I read Flaburgan's comment in https://github.com/mozilla/geckodriver/issues/1070 and searched documents, tested okay.
WebElement dateOfBirth = driver.findElement(By.name("dob"));
dateOfBirth.sendKeys("2012-12-24");
You handle this issue with the following trick:
Change the input type from date to text using JavaScriptExecutor by Selenium
After changing the element type to text the change the date field by sending text with the same format needed to change value, use sendKeys("dd/mm/yyyy").
OR try to use Selenium Actions move to element and click.

How to insert validation in datepicker interactive report in apex5.0

I have one field :P2_DATE, datepicker on an interactive report in apex5.0.
First Question:
How can i create validation thru:
1. A dynamic action
2. A validation process
that gives an error msg: 'Date should not be greater than system date'
when user choose from datepicker.
Second Question:
How to show only today's date in the date picker and disable others dates.
Pls provide steps-by-steps instruction if possible...thxs!!
Add Validation
Set type to PL/SQL Expression and put:
to_date(:P2_DATE,'DD-MM-YYYY') = to_date(sysdate,'DD-MM-YYYY')
You can see this Answer:jQuery Date Picker - disable past dates for disable dates in datepicker but you already have control over date by validation.
Another way is to create custom datepicker from external plugin.

Bootstrap 3 - DateTimePicker - Can time portion be ignored?

I'm using the Bootstrap 3 DateTimePicker. When the user tabs into a field using this component, the current date and time is automatically entered. In some cases this is what I want. However, there are other times I want the component to completely ignore the time portion and not entered by default in a field. I can't seem to find a way to do this.
This will only display the date by default, try and see
$('.future');.datetimepicker({
pickTime: false,
format: 'DD/MM/YYYY'
});

formatting dijit.form.DateTextBox

I am working with the Dojo dijit.form.DateTextBox widget.
My customer would like to display the dates as dd-MMM-yyyy (13-Dec-2012). This is not a problem. However, he would like to be able to use the keyboard to make entries using ddMMyyyy format. Anyone know how to do this?
how about setting the constraints-property of the dijit.form.DateTextBox like that when instaciationg it:
var dateTextBox = new dijit.form.DateTextBox({
value: new Date(), // or what ever
constraints: {datePattern: 'ddMMyyyy'}
});