FeatureRequest Date Helper Function
# 🌱|help-and-getting-started
g
Is it possible to add Date Helper Functions(s) I have an api which have a environment variable DATE. This date is used to prepare the local dev environment. I want to avoid this logic in my app and it would be awesome if i can define a DATE in tepmate files which is "today - 2". For example something like this:
Copy code
yaml
   - name: my-config-map
      kind: ConfigMap
      patch:
        data:
          DATE_START: ${addDays(now(), -2)}
(just googled a little bit and found this structure of functions: https://www.make.com/en/help/functions/date---time-functions) (by the way, I am totally enthusiastic about gardening right now )
b
+1 to this, this would be helpful for dynamic namespaces as well
g
i started to create a PR for this topic, currently hang on date timezone issues 😅 https://github.com/garden-io/garden/pull/5997 do you maybe have an idea to ensure the dates are always in the same timezone for the tests?
b
In the past I’ve used momentJS to achieve that but I think is out of support now lol
g
date-fns is already installed. maybe this can make it possible
looks like `date-fns-tz`is required as a new dependency. i'm currently not sure how garden want's to handle the process to add new dependencies.
b
Not sure if they'll be open to do so, @big-spring-14945 would be nice if you could take a look ❤️
b
Hi @gentle-umbrella-55872 Welcome to the community and thanks so much for the PR! Also, apologies for the slow response. We had an internal hack week that ended up stretching into two weeks so we're a little behind on other things. I'll follow up on GitHub
g
Welcome and thank you too 🙂 also very nicht that you had an hack double-week 🙂 mostly very good investment for such an awesome product! 👍
@brief-restaurant-63679 do you have time to check the adjustments? 🙂