Date view screen
-
Hello,
The date display area is shown in the 1st picture. This is a bit of a problem for mobile uses.
Is it possible to show it as in the 2nd picture? (Of course, does it have a shortcut without being difficult? I have a lot of functions to mess with, I don’t want to mess it up.)Is it possible to display our functions this way without breaking them?
PS: You’re the owner of the best support plugin I’ve ever seen, and thank you.
1. Picture
2. Picture
-
Hello @klingbeil
Thank you very much for using our plugin.
The date fields in our plugin use the Datepicker component of jQuery, which must be associated with an input tag. However, when you set the focus to the input tag, the plugin displays the Datepicker to select the date easily.
To separate the date components, you must emulate it yourself with separate fields:
A number field, with min 1 and max 31
A dropdown field for months.
And a number field with min 1950 and max 2030 (or preferred numbers)
Assuming they are the fields fieldname1, fieldname2, and fieldname3, respectively. You can pre-fill them with the current date by inserting an “HTML Content” field with the following piece of code as its content:<script> fbuilderjQuery(document).on('formReady', function(){ getField('fieldname1').setVal(DAY()); getField('fieldname2').jQueryRef().find('option:eq('+(MONTH()-1)+')').prop('selected', true); getField('fieldname3').setVal(YEAR()); }); </script>
Best regards.
- This reply was modified 1 year, 6 months ago by codepeople.
- This reply was modified 1 year, 6 months ago by codepeople.
Thanks
So how do we show them side by side on mobile?
Since there are 3 separate fields in the calculation functions, which criterion will we calculate? We used to choose a single field because there was only 1 date field? Thank you.The day has come, I wonder why the others did not come?
- This reply was modified 1 year, 6 months ago by klingbeil.
Hello @klingbeil
To display them side by side on mobiles, enter the class name col-xs-4 through their “Add CSS Layout Keywords” attributes. For the dropdown field with months’ names, I recommend you enter the corresponding numbers as the choices’ values (01, 02, 03, …, 12).
Assuming the fields for day, month, and year are fieldname1, fieldname2, and fieldname3, you must concatenate them for calculation.
For example, if you want to increase the date in five days and return the result in date format, the equation would be:
(function(){ var d = CONCATENATE(fieldname1,'/', fieldname2, '/', fieldname3), return GETDATETIMESTRING(DATETIMESUM(d, 'dd/mm/yyyy', 5, 'd'), 'dd/mm/yyyy'); })()
Best regards.
Thank you ??
How do I enter XS4 in a single style file.- This reply was modified 1 year, 6 months ago by klingbeil.
(function(){ var d = CONCATENATE(fieldname30,'/', fieldname33, '/', fieldname29), var adetsure = []; for(let i = 1; i <= 12; i++){ adetsure.push( GETDATETIMESTRING(DATETIMESUM(d, 'dd/mm/yyyy', fieldname27*i, 'd'), 'dd/mm/yyyy') ); } adetsure = adetsure.join('<br>'); jQuery('#calculation-adetsure').html(adetsure); return adetsure; })()
Is the function correct?
Hello @klingbeil
If you use comms symbol at the end of the line of code:
var d = CONCATENATE(fieldname30,'/', fieldname33, '/', fieldname29),
The next line cannot contain the
var
keyword.So, have two alternatives:
var d = CONCATENATE(fieldname30,'/', fieldname33, '/', fieldname29); var adetsure = [];
or
var d = CONCATENATE(fieldname30,'/', fieldname33, '/', fieldname29), adetsure = [];
Best regards.
Thank you
How do I enter XS4 in a single style file.
I would be very grateful if you could answer this as well.
It was super beyond.Hello @klingbeil
col-xs-4
is a predefined class name in the plugin. A row has 12 columns, by entering the class namecol-xs-4
through the “Add CSS Layout Keywords” attribute in a field’s settings, you are telling the plugin to display the field in only four columns of twelve.Best regards.
I did what you said, it happened when I switched from Desktop to mobile phone mode. But I looked at the phones from 3 different devices, it’s still coming back and forth. What could be the problem?
the source of the problem is wp-rocket css cleanup. problem solved, thanks.
Hello;
This is how we did it, but I discovered a new problem.
For example, it calculates date and month results such as 01 / 02 as 1 even though it is 01.
In this case, it causes calculation errors.
For example: When I subtract 09/05/2023 from 26/05/2023..
The formulas detect the date 09/05/2023 as 9/5/2023 and make a calculation error.
How can we solve this?
Thanks
Sample Link
Se?ilen Tarih: Selected Date formula(function(){ var d = CONCATENATE(fieldname35,'/', fieldname33, '/', fieldname36); var secilentarih = CDATE(d, 'dd/mm/yyyy'); jQuery('#calculation-secilentarih').html(secilentarih); return secilentarih; })();
Code Two criter
(function(){ if (fieldname37 > fieldname26) { jQuery('#calculation-kacgunoldu ').html('Se?ilen tarih ileri bir tarihdir.'); return 'Se?ilen tarih ileri bir tarihdir.'; } else { var kacgunoldu = DATEDIFF(fieldname26, fieldname37, 'dd/mm/yyyy', 'd')['days']; jQuery('#calculation-kacgunoldu ').html(kacgunoldu + ' Gün'); return kacgunoldu; } })()
Because of the single digit number Big small can’t detect the date
Hello @klingbeil
The problem here is just the same I described in your other support thread.
If your operands are not date fields, you must use the “Date/Time” operations module.
(function(){ var d = CONCATENATE(fieldname35,'/', fieldname33, '/', fieldname36); var secilentarih = GETDATETIMESTRING(DATEOBJ(d, 'dd/mm/yyyy'), 'dd/mm/yyyy'); jQuery('#calculation-secilentarih').html(secilentarih); return secilentarih; })();
Or you can format the values before the concatenation:
(function(){ var secilentarih = CONCATENATE( IF(fieldname35<10, '0'+fieldname35, fieldname35),'/', IF(fieldname33<10, '0'+fieldname33, fieldname33),'/', fieldname36); jQuery('#calculation-secilentarih').html(secilentarih); return secilentarih; })();
The problem with the second equation is just the same. In the comparison:
if (fieldname37 > fieldname26)
fieldname37 and fieldname26 fields contain texts with date format. So, it does an alphabetical comparison. The correct would be to use the “Date/Time” operations module:
if (DATEOBJ(fieldname37, 'dd/mm/yyyy').getTime() > DATEOBJ(fieldname26, 'dd/mm/yyyy').getTime())
Note I’m using the equations you included in your entry, but the form does not include a fieldname37 field.
Best regards.
one word you are amazing.
Hello;
If you remember the date fields, we show them as 3 separate days, months and years.
Does the code at the bottom show the beginning of the month? Or is it current history?In all the forms I use, it shows the beginning of the month. Is it possible to change it to the current date?
thanks<script> fbuilderjQuery(document).on('formReady', function(){ getField('fieldname1').setVal(DAY()); getField('fieldname2').jQueryRef().find('option:eq('+(MONTH()-1)+')').prop('selected', true); getField('fieldname3').setVal(YEAR()); }); </script>
Hello @klingbeil
Please, edit the line of code:
getField('fieldname1').setVal(DAY());
As follows:
getField('fieldname1').setVal(DAY(TODAY(), '', true));
Best regards.
- The topic ‘Date view screen’ is closed to new replies.