8 years ago
Topic

Hi everyone !

I have 3 fields :

  • 2 calendar fields
  • 1 text field

And I have 2 questions :

1) The first calendar field is the beginning date of an event, the second is the end date's of the event. With the conditional rule or alert message I would like the date of the first field be before the date of the second field and reverse (the beginning is before the end and if it is not the submission is not possible). With the conditional rules there is only : egal ; different ; empty… But there is not superior or inferior value. Have you an idea to do this?

2) In the text field I set up a calculation rules “b – a”. Where “a” is the beginning date et “b” the end date. I would like the result be display in days but the result who is displaying is the difference between years.

For example :

a : 2016/05/24

b : 2016/05/28

b – a = 0

and

a : 2016/05/24

b : 2018/05/28

b – a = 2

I don’t find how to do the calculation in days.

Regards.

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
0
Level 1

Unfortunately calculation won't work, dates are not so easy to compute as other numbers. If you want to display this time  difference on the form when user enters the two dates then you will need to add some custom javacript like this http://stackoverflow.com/questions/2609513/jquery-calculate-day-difference-in-2-date-textboxes

8 years ago
2
Level 1

Thank you very much It's work well.

About the conditionnal state with the end date after the beginning date, do you think what I need is possible with SEBLOD or I need javascript, html...

Regards.

4229 Posts
Kadministrator
8 years ago
1
Level 2

Again you will need some custom validation script, no built in verification that can do that.

8 years ago
0
Level 3

OK I'm going to work on it.

Thank you!

Get a Book for SEBLOD