简体   繁体   English

Joomla日历字段类型

[英]Joomla Calendar Field Type

I have implemented a module which has a Calendar Type as following: 我已经实现了一个具有Calendar Type的模块,如下所示:

  <field 
                   name="file2calendarEnd" 
                   type="calendar" 
                   default="5-10-2008" 
                   label="End date" 
                   description="Select when the slide will be published" 
                   format="%d %B %Y" />

The problem is, when I open the module from the backend, pick a date, for example "23-10-2016" and save it, the next time I open the module , the date will display "22-10-2016". 问题是,当我从后端打开模块时,选择一个日期,例如“ 23-10-2016”并保存,下一次我打开模块时,日期将显示为“ 22-10-2016”。 No matter what date I pick, the module will substract a day when I open it. 无论我选择什么日期,打开该模块都会扣除一天。

The date saves correctly on the databse, because if I pick "23-10-2016" on the module, saves it, and then print it on the frontend, the website will display "23-10-2016" , but if I open the module on the backend, the date will display "22-10-2016". 日期正确保存在数据库中,因为如果我在模块上选择“ 23-10-2016”,将其保存,然后在前端打印,该网站将显示“ 23-10-2016”,但是如果我打开后端上的模块,日期将显示为“ 22-10-2016”。

What can be causing the module to substract a day each time I open the module? 每次打开模块时,每天扣减模块的原因是什么? Thank you 谢谢

I Test your code on localmachine and it works well. 我在localmachine上测试您的代码,效果很好。

But got the same issue when i change User Time zone from Default to New York 但是当我将用户时区从默认更改为纽约时遇到了同样的问题

you can change user timezone in Users > Manage > your user > Basic Settings 您可以在用户>管理>您的用户>基本设置中更改用户时区

You can also check at Global Configuration > Server Settings. 您也可以在全局配置>服务器设置中检查。

Hope it helps 希望能帮助到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM