Date Fields improvements
Date Fields improvements
I noticed 2 annoying thngs with date Fields.
First, it allows you to put an invalid date (fr example, 30 February) and then nothing is saved . If date is invalid shouldn't validate the form.
Second, could be interesting to have date Fields in the form of a simple edit to write 11/07/2016 with the calendar option to choose a date.
Maybe I'm missing something, I have 1hour total in front of appgini since I bought, busy ,sadly, with non appgini projects
First, it allows you to put an invalid date (fr example, 30 February) and then nothing is saved . If date is invalid shouldn't validate the form.
Second, could be interesting to have date Fields in the form of a simple edit to write 11/07/2016 with the calendar option to choose a date.
Maybe I'm missing something, I have 1hour total in front of appgini since I bought, busy ,sadly, with non appgini projects
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
Re: Date Fields improvements
Seems like @grimblefritz is the only forumer walking here
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
Between jobs and bored, and I've owned AG for several years - finally time to do something with it
Re: Date Fields improvements
DevGiu wrote:I noticed 2 annoying thngs with date Fields.
First, it allows you to put an invalid date (fr example, 30 February) and then nothing is saved . If date is invalid shouldn't validate the form.
Second, could be interesting to have date Fields in the form of a simple edit to write 11/07/2016 with the calendar option to choose a date.
Maybe I'm missing something, I have 1hour total in front of appgini since I bought, busy ,sadly, with non appgini projects
I guess what you're looking for is already supported in AppGini. Kindly check the attached screenshots
- Attachments
-
- 2016-08-10_2319.png (58.76 KiB) Viewed 14364 times
-
- 2016-08-10_2315.png (60.64 KiB) Viewed 14364 times
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
No, he wasn't referring to the date picker.
If you use the drop downs for Order Date, you can enter February 31, 2016. That's obviously incorrect. Furthermore, rather than interpreting the date as March 2, as some other date entry systems do, it will (if you subsequently click the date picker) show Feb 29 as being selected - but if you save the record, it will result in a null field as sql will see 2016-02-31 as invalid.
His second request is for a mode, as many date entry systems provide, where you get a masked input area with "__/__/____" where you can simply key in the date. Personally, I'd rather have that plus the date picker, rather than the three dropdowns and the date picker.
If you use the drop downs for Order Date, you can enter February 31, 2016. That's obviously incorrect. Furthermore, rather than interpreting the date as March 2, as some other date entry systems do, it will (if you subsequently click the date picker) show Feb 29 as being selected - but if you save the record, it will result in a null field as sql will see 2016-02-31 as invalid.
His second request is for a mode, as many date entry systems provide, where you get a masked input area with "__/__/____" where you can simply key in the date. Personally, I'd rather have that plus the date picker, rather than the three dropdowns and the date picker.
Re: Date Fields improvements
As grimblefritz explains, the problem is not the calendar is not ok in calendar popuyp. The problem is date is not checked when selected from dropdowns, so it allows to set 30 Feb 2015 for example. 30 Feb is not a valid date, but there are any warning, and when save, this date is not saved on database (because database rejects because is not a valid date) and writes NULL instead. AppGini should add in his core validation for save, for date fields, to check if it's a valid or not.
About second, again, as grimblefritz explains, could be interesting for date fields an option in AppGini to choose how you want to represent date fields.
One way is as now, 3 combos to choose day, month and year. This is cool for tablet/phone but sometimes you may need a simple input to write a date directly with keyboard, and with the ability to select it /change it from a calendar widget.
About second, again, as grimblefritz explains, could be interesting for date fields an option in AppGini to choose how you want to represent date fields.
One way is as now, 3 combos to choose day, month and year. This is cool for tablet/phone but sometimes you may need a simple input to write a date directly with keyboard, and with the ability to select it /change it from a calendar widget.
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
Using @media to detect screen width would be one option. On small (<768px) screens, use the current solution. For wider screens, add a masked text field for keyboard entry.
This thread should be moved to feature requests...
This thread should be moved to feature requests...
Re: Date Fields improvements
Agree. This is the best way to gogrimblefritz wrote:Using @media to detect screen width would be one option. On small (<768px) screens, use the current solution. For wider screens, add a masked text field for keyboard entry.
This thread should be moved to feature requests...
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
OK, following on from grimblefritz's Masked Input contribution here: http://forums.appgini.com/phpbb/viewtop ... f=6&p=6352
I just installed this: https://github.com/RobinHerbots/jquery.inputmask Had a quick play around and found it to be fantastic!
Apart from multiple masks I've added for currency, decimals and an assortment of other bits and pieces, I also had a play around with some date fields I use.
Outcome: Date field with jQuery Datepicker + correctly formatted date (dd/mm/yyyy in my case) + ability to type directly (into just a simple text field - not an AppGini date dropdown field) using jQuery UI
How to:
To make my life a little easier, I chose to use the supplied bundled inputmask.bundle.js I also chose to use Google's hosted jQuery UI
Upload jquery.inputmask.bundle.js to your hooks folder then simply add this to hooks/footer-extras.php (calls the inputmask.js & Google's hosted jQuery UI)
Then add this to tablename-dv.js
Nice neat (mobile friendly) output:
I just installed this: https://github.com/RobinHerbots/jquery.inputmask Had a quick play around and found it to be fantastic!
Apart from multiple masks I've added for currency, decimals and an assortment of other bits and pieces, I also had a play around with some date fields I use.
Outcome: Date field with jQuery Datepicker + correctly formatted date (dd/mm/yyyy in my case) + ability to type directly (into just a simple text field - not an AppGini date dropdown field) using jQuery UI
How to:
To make my life a little easier, I chose to use the supplied bundled inputmask.bundle.js I also chose to use Google's hosted jQuery UI
Upload jquery.inputmask.bundle.js to your hooks folder then simply add this to hooks/footer-extras.php (calls the inputmask.js & Google's hosted jQuery UI)
Code: Select all
<script src="hooks/jquery.inputmask.bundle.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
Code: Select all
(function($) {
$(document).ready(function(){
$('#yourdatefield').datepicker({
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true
}).inputmask('dd/mm/yyyy');
});
})(jQuery);
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
That looks very promising! I'm hoping Ahmad will find a way to nicely integrate this into AppGini. Meanwhile... this is what hooks are for
Re: Date Fields improvements
@peebee I'm right if I think you changed your field to varchar? I can't get it working as Date, changing to varchar, then worked.
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
Re: Date Fields improvements
Apologies, yes I should have added that the field should be varchar rather than a date field. Input mask validates as correct date format so no risk of incorrect data entry.
Re: Date Fields improvements
Uhm..I have to think about this. I don't like too much to change my field datatype just because the inputmask.peebee wrote:Apologies, yes I should have added that the field should be varchar rather than a date field. Input mask validates as correct date format so no risk of incorrect data entry.
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
Could you not leave the field datatype alone, and use jquery to modify the input field on the form?
Re: Date Fields improvements
Date fields are splited in 3
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
Yes, but you could hide them, accept input into a new input field (you create - see my mkfield lib), and then parse the input into the three hidden fields.
Re: Date Fields improvements
Uhm...you have some sample for this done?
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
-
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Re: Date Fields improvements
Nope, just speculating as to how I would address it.