我想<input type="date"/>
在Emberjs 创建一个我有两个问题:
我正在使用Momentjs进行格式化和Ember数据.
我试图像这样扩展Ember.TextField:
App.DateField = Ember.TextField.extend
value: ( (key, value) ->
if value?
if /Date/.test value.constructor #I assume that if the passed value is a Date object then it is arriving directly from the model
if Modernizr.inputtypes.date
moment(value).format('YYYY-MM-DD')
else
moment(value).format('DD-MM-YYYY')
else # if the passed value is not a Date object then the user is typing into the form
if Modernizr.inputtypes.date
value = new Date('value')
else
value
).property()
type: 'date'
Run Code Online (Sandbox Code Playgroud)
对于具有日期输入支持的浏览器,这适用 对于其他浏览器,日期正确显示,但它在模型中保存为(格式错误的)字符串.
如何在后端仍使用Date对象时保持正确的格式?
使用 compose 进行开发时,我将我的应用程序安装在 /var/www/html 中:
volumes:
- ./app:/var/www/html
Run Code Online (Sandbox Code Playgroud)
我的本地副本需要生产网站中的所有图像,这些图像非常多,所以我不想将它们存储在我的小 ssd 中,而是存储在一个大的外部磁盘中。
所以我的图像位于我的 /media/storage/bigdisk/images 中。
可以在已经安装的 /var/www/html 中安装这个位置吗?
这种方式似乎不起作用:
volumes:
- ./app:/var/www/html
- /media/storage/bigdisk/images:/var/www/html/images
Run Code Online (Sandbox Code Playgroud)