« blib/lib/WWW/Shopify/Liquid/Dialect/Web/Tag/Form.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Filter/Eval.pm »
| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package WWW::Shopify::Liquid::Filter::DateSetTimeZone; | ||
| 6 | use base 'WWW::Shopify::Liquid::Filter'; | ||
| 7 | |||
| 8 | sub min_arguments { return 1; } | ||
| 9 | sub max_arguments { return 1; } | ||
| 10 | sub operate { | ||
| 11 | my ($self, $hash, $operand, @arguments) = @_; | ||
| 12 | my ($timezone) = @arguments; | ||
| 13 | return undef unless ref($operand) && ref($operand) eq "DateTime"; | ||
| 14 | return $operand->clone->set_time_zone($timezone); | ||
| 15 | } | ||
| 16 | |||
| 17 | 1; |