/**
*    @Author: Arash Karimzadeh
*    @Email:
*    @Desciption: Here, I post some of my recent
*    researches. Also you can see my code projects.
*/  
Ajax C # Chrome CMS dateNet Design Patterns includeMany JavaScript jBind Joomla jQuery Plugin rails ror RubyOnRails SQLite xul

+ All tags

Content View Hits : 334714
Bookmark and Share
dateNet (jQuery, Date and .Net) PDF Print
Written by Arash Karimzadeh   
Friday, 15 May 2009 16:17

dateNet is a jQuery function which is two-way time converter.Can convert javascript Date object to .Net date format which can be passed to dotNet services (.svc files). It also can convert back the date parameters which are send from server in json object to javascript Date object.

Download dateNet

Current version is 1.0.0
You can get it here.

dateNet

  1. Formats
  2. Examples & Downloads

Formats

$.dateNet(date);

  • date can be javascript Date object or can be dotNet jsonized date.

Examples

  1. Assume that you recieved a {'d':'/Date(1242404957298)/'} as your .Net (c# or vb) service result.
    
                      
    1. var svcPostBack = {'d':'/Date(1242404957298)/'};
    2. var javascriptDateObject = $.dateNet(svcPostBack.d);
    
                      
     
    
                      
                    
  2. If you want to send a javascript date object to service which is a svc file or any other c#/vb service
    
                      
    1. var dateObject = new Date();
    2. var svcAcceptableDateFormat = $.dateNet(dateObject);
    3. //and post it to server in json format
    
                      
     
    
                      
                    

Tags: C # | dateNet | jQuery | Plugin

Last Updated on Monday, 27 September 2010 12:39