Formattering af datoer

<!doctype html>
 
<html lang="en">
   <head>
     <meta charset="utf-8" />
     <title>jQuery UI Datepicker - Default functionality</title>
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
     <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
     <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
     <link rel="stylesheet" href="/resources/demos/style.css" />
     <script>
     // denne funktion formatterer til noget som MySql forstår
     $(function() {
       $( "#datepicker" ).datepicker({dateFormat: 'yy-mm-dd'});
     });
     </script>
   </head>
<body>

<p>Date: <input type="text" id="datepicker" />
</p>

</body>
</html>

I kanbanprototypen er det et problem, at brugeren selv skal formattere datoen på “amerikansk manér”. Det ville være smartere med jQuerys datepicker. Denne kode virker:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enable Notifications OK No thanks

We use cookies - more information

Multimusen.dk will set a few cookies from Doubleclick, Google and the Social Media plugins they ay set some cookies. Some of my pages use APIs - such as YouTube, LinkedIn, Google Fonts, Google Maps, Mapbox, Spotify, Jetpack, Twitter, Facebook &c.. Such plugins may set the odd cookie.

Close