Quick question, how can I add a time_zone set from...
# avo-2
l
Quick question, how can I add a time_zone set from the model into an avo field? eg this works
field :starts_at, as: :date_time, hide_on: [:new], visible: -> (resource:) { resource.model.time_zone.present? }
l
Iโ€™m not at my computer today and canโ€™t check
It might be that it isnโ€™t possible
Actually
It should be possible
l
Well, I hope my syntax is just wrong, but I'm using the same as for visibility and all i get is
missing keyword: :resource
l
Ok
Then do this
timezone: ->(resource:) { โ€ฆ }
Pass the resource to the block
PS: next time start the message with this ๐Ÿ˜›
l
Well, I wish but this doesn't work. It works for visibility but not when I use it on timezone.
l
Ok then try without resource:
It should work without AFAIK
Maybe visible is raising that error?
l
No, I took visibility out. Just trying the bare minimum.
l
Hmmm
Let me troubleshoot it later
It should work ๐Ÿ™ƒ
Can you please open an issue with the configuration and the full stack trace of the error
?
So I donโ€™t forget?
l
Ok, maybe this works
timezone: -> { resource.model.time_zone }
It doesn't crash anyway.
l
Then it moght work ๐Ÿ™‚
l
Yes, it seems to work! Thanks.
l
๐Ÿ™Œ