Update TimeSpan implementation to be consistent with number#519
Update TimeSpan implementation to be consistent with number#519sebastienros merged 10 commits intosebastienros:mainfrom
Conversation
|
It doesn't feel natural that a Date created from a TimeSpan is based on UTC but one created from a Number is based on the culture's TZ. Checking on Shopify's Liquid and other implementations to understand. |
|
Exactly. I personally would expect all of them to respect the culture set by the user. |
|
Go with that (from what I am seeing right now). The truth is in the Number to Date conversion, seems like this in Ruby (Time.at(1)) and in LiquidJS. I assume TimeSpan should follow the same logic, only converting the TimeSpan to a number of seconds. |
|
This implementation matches the output of LiquidJS, the only problem is I lost the milliseconds somehow. 😂 |
|
OK, I think this does it... let me know 👍 |
|
The problem with this is the string output for time span would be a number. I think we need a |
|
I added template tests to verify how a |
|
@sebastienros Have you had time to consider how a time span should behave in Fluid? 👀 |
|
@danielmpetrov let me know if you are ok with my changes and I'll merge it. |
|
@sebastienros Looks good to me, and makes sense. Glad this is resolved. 😄 |
Fix #517