Fork me on GitHub
Ben Halton11:09:57

Hi - I've upgraded tick form to, my app is now blowing up. I used to used things like (tick/date "2021-09-23T14:16:00") to get the date part and (tick/time "2021-09-23T14:16:00") to get the time part but it seems unhappy about this now

Ben Halton11:09:40

am I missing something, is this deliberate, what's recommended practice here now ?

Ben Halton11:09:09

it works if I do (tick/date (tick/date-time "2021-09-23T14:16:00"))

Ben Halton11:09:53

I guess before I just hack in the fix I wanted to see if I had missed something

Ben Halton12:09:38

hmm looking at the docs I see any reference to calling time on a date-time string so maybe that just kinda happened to work

Ben Halton12:09:23

appreciate I'm talking to myself at the moment but it seems like the version of js-joda/core required has gone from 1.x to 3.x so maybe that explains it


hi Ben. yes previously the parsing had a good go at working out what your string might be. this was very slow and might result in surprising behaviour. so, assuming you know the format of your input string, as you suggest, you should create the entity it corresponds to (date-time, in your case) then extract the bit you want. so, yes (tick/date (tick/date-time "2021-09-23T14:16:00"))`` is the right way to do it now.

Ben Halton13:09:18

gotcha thanks. I guess the problem I have now is working out where I need to convert to a date-time and when I just have dates which will teach me to write tests 😉