Server JS Script for Next Dates

Hi all, I have a javascript element on the front end which finds the next date that occurs in a given list of days. (Next date that occurs on a Monday or Wednesday etc). It works great but I can’t replicate it on the backend workflows using server script.

I’ve tried all sort of different JS from chat gpt but none of the them give me the date output I need. Any advice would be hugely appreciated! I bet it’s so simple when you know how!

1 Like

Curious to know why you might not be using the native operators in Bubble to achieve this.

1 Like

How would I do that?
So what I have is a thing with a list of days on it, (Mon, Tues etc)
And I want to run a backend workflow and then schedule it to run again on the first date that includes one of the days on the thing.

How would I acheive that with bubbles operators?

There’s a plugin to generate a list of dates and I’ve created the workflow for the rest in the demo below. Feel free to test and see if it solves your use-case :slight_smile:

OK that’s neat, I see how you’ve used the operators. Is there a way to get the list of dates without that plugin? I’m trying not to rely on plugins.

No problem :slight_smile:

You can actually refer to this then - 1T - List of Dates Plugin | Bubble

This plugin is very stable and used by lots of devs. If you want, you can use Toolbox to write a server script by taking reference from here, or even fork the plugin (since it’s open source) and create a private plugin for your app so that you have ownership of the code.

Let me know if this makes sense

This topic was automatically closed after 70 days. New replies are no longer allowed.