date calculation

In Filemaker I do:

Field: Datum1(date)
Field: Datum2(calculation) Datum1 + 1

If I fill in Datum1 then Datum returns automaticly the next day.
How can this be done in Servoy?

Nasty problem,

Have you tried something with getDate() (see: JS-LIB)
This returns a daynumber, so you can make a calculation with the days.
Now you have to reconstruct the date itself.
I haven’t been able to do this up till now…
Edward, help us plse.

Good ol JavaScript

var a = new Date();
a.setDate(a.getDate()+1);

Hi Edward,

I trying to implement this, but it won’t work.

I have a global: date1
and the following (stored) calculation: date2

If I type for example in date1: 15-06-2003
I want that date2 is automaticly calculated to: 16-06-2003

what is the calculation of: date2?

the calculation script of date2 should be:

var a = date1;
a.setDate(a.getDate()+1);
return a;

or the short version should also work:

return date1.setDate(date1.getDate()+1);

Here’s a link to a couple of usefull date related javascripts.
http://www.lowcostweb.us/scripts/