拦截来自 BlazeDS 的 Date 对象并调整时区差异
我正在开发一个应用程序,该应用程序已接近开发周期结束,并且大部分已通过用户测试。我们最近意识到,不需要将日期灵活地转换为客户的本地时区,因为我们所有的日期都是美国东部时间,并且不包含时间数据。由于 BlazeDS 以 UTC 格式发送日期,这会导致日期被转换为 EST 以西时区的前一天。
最好的解决方案是进入并重构所有日期以调整时区偏移,但在现阶段这是不可行的。由于我们应用程序中的所有日期都不关心时间,因此我真的希望能够拦截 BlazeDS 遇到的所有日期对象并调整时区偏移。可以这样做吗?如果没有,是否有任何“交叉”解决方案?
谢谢
I am working on an application that is near the end of its development cycle and has mostly passed user testing. We recently realized that having flex convert dates to the client's local timezone is not desired, as all of our dates are in EST and contain no time data. Since BlazeDS sends dates in UTC, this results in the dates being converted to the day before in timezones west of EST.
The best solution is to go in and refactor all dates to adjust for the timezone offset, but that is just not doable at this stage. Since all dates in our application don't care about time, I would really like to be able to intercept all Date objects that come across BlazeDS and adjust for the timezone offset. Is it possible to do this? If not, are there any "cross cutting" solutions?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想看看 http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/mx/rpc/remoting/RemoteObject.html#convertResultHandler
您可以在 RO 调用之前检查所有结果传递给处理程序。
我不确定这是更好的方法...因为您将检查返回的每条消息!
You might want to take a look at http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/mx/rpc/remoting/RemoteObject.html#convertResultHandler
You can inspect all the results from a RO call before they get passed to handlers.
I'm not sure that its a better way... as you'll be inspecting every message that comes back!