Replacement for plugins.DateUtils.createDateSeries

Questions and answers on developing, deploying and using plugins and JavaBeans

Replacement for plugins.DateUtils.createDateSeries

Postby drookwood » Thu Aug 23, 2018 1:40 pm

In Servoy 5 I have been using the DateUtils plugin to create a series of dates which has been useful. In Servoy 8 I am now trying to find a suitable replacement for this function using the svyDateUtils but don't see an obvious option other than looping from start date to end date and programmatically creating a series that way. Is there another way?
David Rookwood

SAN Developer
drookwood
 
Posts: 262
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK

Re: Replacement for plugins.DateUtils.createDateSeries

Postby swingman » Tue Aug 28, 2018 2:44 pm

Not sure if this is of any use in your case, but PostgreSQL has set-returning functions which can be used to generate sequences including those of dates:
Code: Select all
SELECT generate_series('2018-08-01'::timestamp,'2018-08-25', '1 day')
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1215
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Replacement for plugins.DateUtils.createDateSeries

Postby drookwood » Tue Aug 28, 2018 3:23 pm

Hi Christian,

Thanks for that - I will file it away for when I switch from Sybase (!) to PostgresSQL, hopefully soon.
David Rookwood

SAN Developer
drookwood
 
Posts: 262
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 5 guests