基金会5日期选择器失败,抑或是我 [英] Foundation 5 Datepicker failing, or is it me

查看:198
本文介绍了基金会5日期选择器失败,抑或是我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OK,我运行的基础与5 SASS我​​下载的日期选择器由彼得·贝诺这里:

OK, I am running FOundation 5 with SASS I downloaded the Datepicker by Peter Beno here:

https://github.com/najlepsiwebdesigner/foundation-datepicker

现在我知道,它说,它是为基金会4条作出的,但我不明白为什么它不会在基金会工作5呀JavaScript是有点超过我的头,但它为什么我使用别人别人的日期选择器。

Now I know that it says it is made for Foundation 4, but I see no reason why it won't work in Foundation 5. Yeah the javascript is a bit over my head, but that it why I'm using someone elses date picker.

下面是我走上实现这个日期选择器成基金会5。

Here are the steps I took to implement this datepicker into Foundation 5.

1)我改名基金会datepicker.js 来foundation.datepicker.js并已将其列入到JS包。我的页面现在载入此脚本。

1) I renamed the foundation-datepicker.js to foundation.datepicker.js and included it into the JS bundle. My page is now loading this script.

2)更名为基础,以datepicker.css _datepicker.scss 并已将其列入了SASS文件夹中。现在已被吸进我的缩小的CSS文件,我检查。

2) renamed foundation-datepicker.css to _datepicker.scss and included it in the sass folder. It is now being sucked into my minified css file, i checked.

然后我用这个code我的网页上:

    @Html.TextBoxFor(model => model.StartedDate, new { type = "text", id = "dp1", @class = "span2" })

从asp.net的MVC输出到这一点:

    <input class="span2" id="dp1" name="StartedDate" type="text" value="1/1/1981 12:00:00 AM" />

此外,我添加了这个调用jQueryUI的后

Also I added this after the call to jQueryui

    <script type="text/javascript">
    $('.datepicker').fdatepicker()
    </script>

下面是文档页面,我将更新,并为更多的人清楚,如果他能帮助我在基金会5得到这个工作。

Here is the docs page, which I would update and make more clear for the guy if he can help me get this working in Foundation 5.

http://foundation-datepicker.peterbeno.com/example/example.html

和我测试了它在Mozilla避免铬合金蹩脚的日期选择器。我在做什么错。它是最有可能与基金5相冲突是否有其他日期选择器有点类似我可以使用所jQueryUI的基础是不吸。

And I tested it in Mozilla to avoid Chromes crappy datepicker. What am I doing wrong. Is it most likely conflicting with Foundation 5. Is there another datepicker somewhat similar I can use that is jQueryUI based that doesn't suck.

推荐答案

我试过彼得的UI实现,我已经遇到了麻烦一样,所以我建立了自己的界面,日期和时间采摘基金会。这是一个有点新鲜,但我的公司已经用它在生产现场已经和它的持股待涨。

I've tried Peter's UI implementation, and I've had trouble as well, so I built my own interface for Date and Time picking for Foundation. It's a little fresh, but my company has been using it on a production site and it's holding up.

https://github.com/jockmac22/foundation_calendar_date_time_picker

我建立它周围的不显眼的JavaScript,所以它很容易通过在输入字段数据 - 属性来实现。

I built it around unobtrusive javascript, so its easy to implement through data- attributes in the input field.

我有一个SCSS文件,您可以在你的基础建设SASS直接纳入所需的CSS到您的最终的CSS文件。这样,您可以自定义你现有的基础上设置的着色,并进行任何其他更改轻松SASS框架内。

I have an SCSS file you can include in your foundation SASS build to incorporate the required CSS directly into your final CSS file. This way you can customize the coloring with your existing foundation settings, and make any other changes easily inside the SASS framework.

它支持自定义日期,时间和字段值的格式,所以你可以有日期和时间的用户友好型显示,与ISO标准(或任何其它格式)存储在该领域的最终值。我用了Ruby的strftime格式化选项作为日期格式的基础。

It supports custom date, time and field value formats so you can have a user friendly display of the date and time, with an ISO standard (or any other format) as the final value stored in the field. I used the Ruby strftime formatting options as the basis for the date formats.

让我知道你的想法,如果你决定尝试一下。

Let me know your thoughts if you decide to try it.

这篇关于基金会5日期选择器失败,抑或是我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆