Axel Latvala
Axel Latvala

Reputation: 576

datejs wont parse my date

I am trying to parse a FINNISH date eg. 13.03.1990. Javacript won't do this but I found DateJS that should be able to.

I implemented DateJS into my project but it still won't work!

Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pick the date</title>
<link type="text/css" href="css/smoothness/jquery-ui-1.8.14.custom.css" rel="Stylesheet" /> 
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.14.custom.min.js"></script>
<script src="inc/date-fi-FI.js" type="text/javascript"></script>
<script type="text/javascript">
function parseDate() {
    var date = $('#date').val();
    var parsedDate = Date.parse(date);
    alert('Parsed date: '+parsedDate);
}
</script>
</head>

<body>
    <form>
        <input type="text" name="date" id="date" value ="13.03.1990" />
        <input type="button" onclick="parseDate()" value="Parse the date" />
    </form>
</body>
</html>

Try it for yourself: http://resk.latvalashop.com/date.php

Upvotes: 1

Views: 313

Answers (2)

Fenric
Fenric

Reputation: 11

@Flambino is correct, the link is dead. Testing the same code with a working link and your code works as expected.

Upvotes: 0

Flambino
Flambino

Reputation: 18773

You just have a broken link. You test page doesn't load the DateJS file; I get a 404 error instead

The URL it's looking for is http://resk.latvalashop.com/inc/date-fi-FI.js but that doesn't exist

Upvotes: 1

Related Questions