1

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

4

2 に答える 2

1

リンクが壊れているだけです。テスト ページは DateJS ファイルをロードしません。代わりに 404 エラーが表示されます

探している URL はhttp://resk.latvalashop.com/inc/date-fi-FI.jsですが、存在しません。

于 2011-07-29T13:00:06.530 に答える
0

@Flambino は正しく、リンクは無効です。有効なリンクを使用して同じコードをテストすると、コードが期待どおりに機能します。

于 2011-07-29T13:06:58.827 に答える