更改 ExtJS 中的日期格式不会更改提交的日期
我正在使用 Extensible 的日历 http://ext.ensible.com/products/calendar/但是当提交事件日期时,它没有使用我想要的 MySQL 后端格式。
我试图让我的可扩展日历日期与我的 mySql 日期格式匹配,但我不知道我是否在正确的位置更改它。
这是我的 EventMappings
Extensible.calendar.data.EventMappings = {
EventId: {name: 'EventId', mapping:'id', type:'int'},
CalendarId: {name: 'CalendarId', mapping: 'roomId', type: 'int'},
Title: {name: 'Title', mapping: 'description'},
StartDate: {name: 'StartDate', mapping: 'start', type: 'date', dateFormat: 'Y-m-d H:i:s'},
EndDate: {name: 'EndDate', mapping: 'end', type: 'date', dateFormat: 'Y-m-d H:i:s'},
RRule: {name: 'RRule', mapping: 'rrule'},
Notes: {name: 'Notes', mapping: 'notes'},
Reminder: {name: 'Reminder', mapping: ''},
Location: {name: 'Location', mapping: ''},
Url: {name: 'Url', mapping: ''},
IsAllDay: {name: 'IsAllDay', mapping: ''},
User: {name: 'User', mapping: 'user'},
Approved: {name: 'Approved', mapping:'approved', type:'boolean'}
};
当我尝试向后端发布更新时,尽管日期似乎以这种格式发送 Wed Dec 14 2011 01:00:00 GMT-0500 (EST)
我已经为此绞尽脑汁有一段时间了,但就是想不通。我没有看到其他人遇到同样的问题,所以我假设我在某个地方做错了什么。
任何帮助都会很棒。谢谢。
I'm using Extensible's Calendar http://ext.ensible.com/products/calendar/ but when submitting an event date it's not using the format I'd like for my MySQL backend.
I'm trying to have my Extensible Calendar dates match my mySql date format but I don't know if I'm changing it in the correct spot.
Here is my EventMappings
Extensible.calendar.data.EventMappings = {
EventId: {name: 'EventId', mapping:'id', type:'int'},
CalendarId: {name: 'CalendarId', mapping: 'roomId', type: 'int'},
Title: {name: 'Title', mapping: 'description'},
StartDate: {name: 'StartDate', mapping: 'start', type: 'date', dateFormat: 'Y-m-d H:i:s'},
EndDate: {name: 'EndDate', mapping: 'end', type: 'date', dateFormat: 'Y-m-d H:i:s'},
RRule: {name: 'RRule', mapping: 'rrule'},
Notes: {name: 'Notes', mapping: 'notes'},
Reminder: {name: 'Reminder', mapping: ''},
Location: {name: 'Location', mapping: ''},
Url: {name: 'Url', mapping: ''},
IsAllDay: {name: 'IsAllDay', mapping: ''},
User: {name: 'User', mapping: 'user'},
Approved: {name: 'Approved', mapping:'approved', type:'boolean'}
};
When I try to post an update to my backend though the date seems to be sent in this formatWed Dec 14 2011 01:00:00 GMT-0500 (EST)
I've been banging my head against this for a while and just can't figure it out. I haven't seen anyone else with the same issue so I assuming I'm doing something wrong somewhere.
Any help would be terrific. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了类似的问题,并通过使用相关日历视图(在我的例子中为月视图)的 dateParamFormat 属性解决了它。
I had a similar problem and solved it by using the dateParamFormat property of the relevant calendar view (month view in my case).
您的商店/代理/读取器/写入器配置是什么样的?该问题与 EventMappings(映射从服务器读取的传入数据)无关——它与应用程序中的数据层如何发送请求中的日期有关。另外,您使用哪种操作系统/浏览器?
What does your store / proxy / reader / writer configuration look like? The issue would not be related to the EventMappings (which map incoming data being read from the server) -- it would be related to how the data layer in your app is sending dates in requests. Also, which OS / browser are you using?