Posts

Showing posts from January, 2013

Why my bootstrap css is not working on mobiles?

Bootstrap css is not working on mobiles when all is fine in your  Bootstrap  html code. and when you open your site on mobile then it shows as  it shows onn your pc. and you still you are frustrate that why  Bootstrap css  is not working. so please check your meta tag did you add this code in of head tag of html <meta name="viewport" content="width=device-width, initial-scale=1.0" />  most of the people when create Bootstrap css the forgot to add this on head tag in html thats why this css not working on mobiles browser so add this code in head tag of html code  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

How to compare two dates via javascript?

How to compare two dates via java-script or how to check two dates that which one is greater and smaller? here is a code where you can check that which date is greater then other or same as vice verse. Simply copy and paste below code in your html file and run the file and change variable according to your need. Note: date format can be in two format one  2012-12-26 00:00:00  or 2012/12/26 00:00:00 Date compare <script> var s_date1 = "2012-12-26 00:00:00"; var en_date1 = "2012-12-26 00:00:00"; var s_date1_new=s_date1.replace(/-/g,"/"); // this line is for if date format is in hyphen like  2013-12-12 00:00:00 var en_date1_new=en_date1.replace(/-/g,"/"); // this line is for if date format is in hyphen like  2013-12-12 00:00:00 var date_ini = new Date(s_date1_new).getTime(); var date_end = new Date(en_date1_new).getTime(); if(isNaN(date_ini)) { alert("Start date format is wrong!"); return false; } if(isNaN(