Posts

Showing posts with the label string to date time conversion

javascript : Date.addMinutes(number)

  javascript : Date .addMinutes( Number ) Target: Applicable with  Date  Data Type. Description : Add/Subtract Minutes from Date and return new Date object. Syntax: Date .addMinutes( number ) Usase: var dd = '1 Apr 2020 12:00 AM'.toDateTime(); dd.addMinutes(1); It return "Wed Apr 01 2020 00:01:00 GMT+0530 (India Standard Time)" dd.addMinutes(-1); It return "Tue Mar 31 2020 23:59:00 GMT+0530 (India Standard Time)" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.toPascalCase()

  javascript : String .toPascalCase() Target: Applicable with  String  Data Type. Description : convert string to a single word in camel case format. Every words first letter in capital letter. Note: convert into PascalCase from camelCase, snake_case and kebab-case. Syntax: String .toPascalCase() Usase: " hello     how     are     you ? ".toPascalCase() It return string "HelloHowAreYou?" "hello-how-are-you-?".toPascalCase() It return string "HelloHowAreYou?" "hello_how_are_you_?".toPascalCase() It return string "HelloHowAreYou?" "helloHowAreYou?".toPascalCase() It return string "HelloHowAreYou?" Download MYJS.js Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : Date.format(strFormat)

  javascript : Date .format( strFormat ) Target: Applicable with  Date  Data Type. Description : format Date to string with given format string. strFormat Description dddd  : full week day name as ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] ddd  : three letter week day name as ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] dd  : two digit date of month prefix with zero. d  : date of month without prefix with zero. MMMM  : full month name as ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]. MMM  : three letter month name as ["Jan", "Feb", "Mar", "Apr", "May", "Jun...

javascript : String.toDateTime()

  String .toDateTime() Target: Applicable with  String  Data Type. Description : convert string to Date object. Date should be "dd-MMM-yyyy hh:mm:ss tt" or "dd-MM-yyyy HH:mm:ss" Note: if date not passed then current date and given time will return. In case of invalid date string it return "1-Jan-1900 00:00 AM" Syntax: String .toDateTime() Usase: "11-Oct-2019".toDateTime() It return Date "Fri Oct 11 2019 00:00:00 GMT+0530 (India Standard Time)" "11/Oct/2019".toDateTime() It return Date "Fri Oct 11 2019 00:00:00 GMT+0530 (India Standard Time)" "11.Oct.2019".toDateTime() It return Date "Fri Oct 11 2019 00:00:00 GMT+0530 (India Standard Time)" "5Jun2019".toDateTime() It return Date "Wed Jun 05 2019 00:00:00 GMT+0530 (India Standard Time)" "15Jun".toDateTime() It return Date "Sat Jun 15 2019 00:00:00 GMT+0530 (India Standard Time)" "28, Jun".toDateTime(...