WhatSock / apex

Apex 4X: The Comprehensive ARIA Development Suite
MIT License
28 stars 10 forks source link

DateFormats with '-' separator instead of '/' #52

Closed GuptSmita closed 12 months ago

GuptSmita commented 12 months ago

hello, I am trying to specify different format like "dd-mm-yyyy" but it seems not working. I think its breaking on 'OnActivate" on this line dc.target.value = dc.formatDate(dc); Can you please help? Thanks a lot

accdc commented 12 months ago

Hi, if you still need help with this just let me know. :)

GuptSmita commented 11 months ago

Thanks for quick response. Much apprciated. I have two questions though- Do you have any documentation for datepicker's additional methods ? Also, Do you have any example where you have used date format as "DD-MM-YYYY"?

accdc commented 11 months ago

Hi, no problem, you can see a list of available methods at: https://whatsock.com/Templates/Datepickers/index.htm Scroll down to the section "Programmatic control".

This is also available in the download within the file: Help/Module Imports/Dynamic Components/Datepicker.txt

I don't have any live examples of the alternative date format, but you can easily specify this within the setup config by setting the desired date format like so:

// Using a token system, set a specific date string format to be used when setting the selected value into the calendar input box
// 'YYYY': 4 digit year, 2019
// 'MMMM': Full name of month, January, etc.
// 'dddd': Full name of weekday, Monday, etc.
// 'MM': 2 digit month, 01, etc.
// 'DD': 2 digit day, 01, etc.
// 'Do': getDateOrdinalSuffix, 1st, 2nd, 3rd.
// 'M': 1 or 2 digit month, 1 through 12
// 'D': 1 or 2 digit day, 1 through 31.

inputDateFormat: 'MM/DD/YYYY',
accdc commented 11 months ago

Simply change the / symbols within the date string to '-' to change the output.