<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BasicCultureFormatting.aspx.cs"
    Inherits="Localization.BasicCultureFormatting" %>

<!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 runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server" EnableScriptGlobalization="true" />

    <script type="text/javascript">

    Number.parseLocaleFixed = function(value) {
        return Number.parseLocale(value.replace(" "," "));
    } 

//    // convert "12/22/2007" into a date using the invariant culture
//    var date1 = Date.parseInvariant("12/22/2007");

//    // convert "22/12/2007" into a date using the local culture
//    var date2 = Date.parseLocale("22/12/2007"); 

//    // format date1 as a short date using the local culture
//    alert("Localized Short Date Format: " + date1.localeFormat("d") + "\n\nInvariant Short Date Format: " + date2.format("d"));

//    // convert "4,305" into a number using the invariant culture
//    var num1 = Number.parseInvariant("4,305");

//    // convert "4 305" into a number using the local culture (which is French)
//    var num2 = Number.parseLocaleFixed("4 305"); 

//    // format num1 as a currency using the local cultrue
//    alert("Localized Currecny Format: " + num1.localeFormat("c") + "\n\nInvariant Currency Format: " + num2.format("c"));
//    


var dateTime = new Date(); //Date.parseInvariant("SAT, 22 DEC 2007 12:15:00 GMT");
alert (String.format("The current invariant formatted date is {0:d}\n\nThe current invariant formatted time is {0:T}", dateTime));
alert (String.localeFormat("The current locale formatted date is {0:d}\n\nThe current locale formatted time is {0:T}", dateTime));

//MyObject = function() { }

//MyObject.prototype = {
//    format: function(argFormat) {
//        return "invariant format.";
//    },
//    localeFormat: function(argFormat) {
//        return "locale Formatted.";
//    }
//}

//var newObj = new MyObject();
//alert (String.format("Test Normal Format {0}", newObj));
//alert (String.localeFormat("Test localeFormat {0}", newObj));


    </script>

    </form>
</body>
</html>
