Closed RyanTaite closed 6 years ago
Hi Ryan, it sounds like the Datepair script is failing to load in the browser. You can check this with Chrome Devtools - you should datepair.js
loaded successfully in the Network tab.
The node_modules
folder typically isn't made public. The simplest fix would be to copy the datepair scripts into your /Scripts
folder.
Here is a screenshot from my Chrome's Dev Tools Network Tab. Looks like both jquery.datepair.js
and datepair.js
are loading from the /node_modules
folder.
No difference if I copy jquery.datepair.js
and datepair.js
to my /Scripts
folder and call them like so:
<script type="text/javascript" src="~/Scripts/jquery.datepair.js"></script>
<script type="text/javascript" src="~/Scripts/datepair.js"></script>
Dang, I was hoping it was a simple fix. Unfortunately it's difficult for me to debug further without a working demo to poke and prod.
If it helps, I made a super small skeleton project recreating the error: https://github.com/RyanTaite/DatePairErrorRecreation
I've never used C# - I'm sorry but I'm not going to be able to debug this
Dang, thanks anyways!
I had the same issue, I fixed it by importing jquery.timepicker invidually.
@Gigaika I added "timepicker": "1.11.12"
to package.json
's devDependencies
section and included the downloaded folder into the project.
I then added <script type="text/javascript" src="~/node_modules/timepicker/jquery.timepicker.js"></script>
above the datapair scripts and I see no change. Same for when adding below.
Is this what you did?
I'm trying to use this date/time picker but can't seem to figure it out yet. I'm trying to follow the jQuery and Date only example on this page: https://jonthornton.github.io/Datepair.js/
I'm currently getting no changes to my textboxes, a warning in my .cshtml file that
start
andend
areUnknown CSS classes
, and this error in my Firefox console:I'm using
I also just added a npm
package.json
file to my project with this inside it:and I've gone ahead and included the
/node_modules
folder into my projectIn my .cshtml file I have this for the text boxes I want to apply this too (column formatting, labels, and validation removed):
CallStartTime
andCallEndTime
are both of typeDateTime
. This is where I see theUnknown CSS
errorFor now I have my JavaScript at the bottom of the same file
When everything is loaded I have this HTML (fluff removed):
And this javascript load order:
Hopefully the amount of details I've added here does more good than harm. Any ideas what I'm doing wrong here?