I'm working with a programm in which some settings shall be imported by values set in an Pdf-form that is editable. Adobe Acrobat DC Pro is the program I use for creation of the Pdf-form. Problem is it just has controls like TextBox, ComboBox etc. but no DatePicker.
After I searched the internet I found the guys from Acroform and they have a Javascript that enables the use of a DatePicker inside of a Pdf-form. I downloaded their code from here and had no problem to get it running but the DatePicker starts with Sunday. I guess that is due to the fact that the Date Enumeration starts with 0 = Sunday, 1 = Monday etc. but I would like the change the DatePicker to start with Monday(the way Windows displays a DatePicker), problem is I have no experience in Javascript. I thought that if I just change all the Arrays of Days in the code to Sunday being at the end instead of the start would work but this just makes the dates for Monday-Saturday to be empty and then it starts with Sunday and paints on to the right where no Day-captions are anymore. Because I habe no experience in Javascript I cannot find out which code is responsible for this behaviour.
My questions are:
1) Does anyone have had a similar problem with a DatePicker in Javascript and found a solution he/she could share ?
2) Does anyone know a different Javascript DatePicker Example that can be used without having to buy it ?
The code has roughly 1200 lines of code so I will not post it here but it can be downloaded here.
Why not saying that you are talking of the FormRouter date picker (I guess they fixed the missing August 31 in the meantime). But then, you get what you pay…
Anyway, it is possible to create a date picker using the Dialog Object in Acrobat JavaScript. This then allows to freely configure the date picker whether to follow ISO standards (beginning the week with Monday), or USAn use (beginning the week with Sunday). It is essentially using the capabilities of the Date Object in JavaScript.
That date picker is available as developer toolkit. But not for free; creating smart and complex PDF applications is my business, and there is quite a bit of work behind that datepicker (however, if the datepicker is part of a project, it is not billed separately…). Feel free to contact me in private for further information an pricing (several customers told me that pricing is reasonable).
Anyway, studying the Date Object, understanding arrays, and grasp some knowledge about the Dialog Object would get you in the shape to create your own version.
The trick with the beginning of the week is indeed the enumeration of the day of the week. Add an offset, and you can set it to any day…
In short the answer to question 1: Yes; problem solvable and solved; to question 2: Yes, but No.
Related
I wanted to use a date time picker in React where I can view the time as Military time and not have an option for AM/PM and a sample code that can help me understand it.
Thanks!
If you want to use the 24 Hours rule on both iOS and Android and see that the is24Hour is not working on iOS, then you'll need to force the app to use en_GB as default DatePicker locale.
To do so, edit your AppDelegate.m file, and add [[UIDatePicker appearance] setLocale:[[NSLocale alloc]initWithLocaleIdentifier:#"en_GB"]]; to application didFinishLaunchingWithOptions
The date on the selector (ngx-bootstrap datepicker) is showing one day older date.
If the date value is
2019-04-26T18:30:00
The datepicker shows it as 04/25/2019.
For the datepicker input I doing the following thing-
this.dateAdded = new Date(this.user.dateAdded).toLocaleDateString();
I am at GMT+5:30 so even adjusting for timezone I don't understand why it is going one day beind.
After spending the better part of the day and learning about the complexities that come with displaying date in Javascript the answer to this specific question is a bit of an anticlimax.
The version of ngx-bootstrap I was using (5.2) has some bugs with the datepicker.
Use the 5.1 version so as to not have the issue with the date.
It seems like ToLocaleDateString which only gives the date component if adjusted for timezone by bsDatePicker (at midnight) gives the previous day.
https://github.com/valor-software/ngx-bootstrap/issues/3609
Reference for github issue regarding the same.
I would like to create an input field which lets the user select a month and a year. HTML5 introduced the input type "month" which suits my problem. It works fine in Chrome, Opera and Edge (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month).
If the user is using Firefox (or IE or any older Browser version), the input field doesn't show a date picker but instead expects a plain text input.
How can I implement my form in a way, that if the current browser supports input type="month", it shows the native browser datepicker, and if that's not the case, it shows a custom date picker? I expect the input type="month" to work in future Firefox versions and would like to automaticly use that functionality once it exists.
What would be the best way to implement a custom date picker?
I'm already using JQuery in my project. Furthermore I'm using Laravel, although I don't think that Laravel offers any utily in that regard.
Yes HTML5 elements are not supported on the old browsers. You can't expect new technologies to work on old systems. :)
So as you already know you can use a custom date picker. And I will recommend http://www.daterangepicker.com/, as I have been using it for some time now.Pretty stable.
Not recommending jQueryUI datepicker anymore, as it come with lot of other stuff as a bulk and it will slowdown your app loading time.
Give shot to daterangepicker it will solve your issue. ;)
Angular UI datepicker altInputFormats does not allow formats that I need. I want to avoid using jQuery.
I need users to be able to input things like:
10JUN16
10JUN2016
AUGUST12
06/12 = June 12th, current year
06-10
061016
But the uibDateParser does not have compatible format codes.
I found a similar issue here but the advice was to change the source code which I'd prefer not to mess with. I'm thinking that some kind of parser in my Angular controller might help?
Any ideas? Here is a plunker I've been playing with
where I have
$scope.altInputFormats = ['M!/d!/yyyy', 'dd.MM.yyyy', 'dd-MMM-yy', 'dd-MMM-yyyy', 'd!-M!-yy'];
But the others won't work.
http://plnkr.co/edit/yNERf1jrtThVvJ1SBjBY?p=preview
I have an application that is in the late stages that uses pickadate.js. It's been reported to me that JAWS does not work with the date picker since the arrow keys are required to select a day and they are already mapped to something else in JAWS.
Is there a good way to get around this issue and still make the datepicker accessible for JAWS users? Any insight would be appreciated. Still learning about accessibility on the web.
If you are using pickadate.js version 3.5.5 then the arrow keys will work properly, however it is using aria-activedescendant to track the currently 'focusssed' date and this is not yet supported in all screen readers (does not work for example on OS X with VoiceOver and as far as I know also does not work with JAWS)
You could change the code https://github.com/amsul/pickadate.js of the datepicker to use ARIA live regions to announce the dates as the user uses the arrow keys. It is based on jQuery and there is a jQuery library that you could integrate to do this:
https://github.com/dylanb/a11yfy
You would essentially call jQuery.a11yfy.assertiveAnnounce(msg); every time the aria-activedescendant changed with the contents of that cell.
An alternate date picker is available here http://freqdec.github.io/datePicker/, it claims to be fully accessible but it also seems to suffer from the arrow keys not working (I tested in NVDA, I suspect JAWS will have the same issue).
However, Look at demo #9 here: http://freqdec.github.io/datePicker/demo/ it features a static date (not a popup) picker which does work with NVDA, it even dutifully announces each date as you use the arrow keys to navigate around the control.