fix(datepicker): respect custom separators in dateFormat #717
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Description
Fixes a bug where the
dateFormatoption doesn't respect custom separators. Dates are always formatted with dots (.) regardless of the separator specified in the format string.Problem
{ "dateFormat": "DD-MM-YYYY" }19-10-202519.10.2025❌Solution
extractSeparatorFromFormat()method to auto-detect separator from formatsetInputValue()to use extracted separator as priority.to-for better international compatibilityformatDate()method for consistencyTesting
Tested with multiple formats:
DD-MM-YYYY→19-10-2025DD/MM/YYYY→19/10/2025DD.MM.YYYY→19.10.2025YYYY-MM-DD→2025-10-19MM/DD/YYYY→10/19/2025Backward Compatibility
dateFormatcontinues workingdateSeparatoroverride continues workingdateFormatusagePriority Order
The fix implements the following priority for separator selection:
dateFormat(if present)dateSeparatorfrominputModeOptions(if specified)-(dash)Checklist
Closes #716
This pull request improves how the date separator is determined and handled throughout the
HSDatepickerplugin. The main change is the introduction of logic to automatically extract the separator from the provided date format, ensuring consistency and reducing manual configuration. Default separators have also been standardized.Date separator extraction and handling:
extractSeparatorFromFormatto automatically determine the separator from a date format string, defaulting to"-"if none is found.setInputValueto use the extracted separator from the date format, falling back to configuration or"-"as needed.changeDateSeparatorand related logic from"."to"-", ensuring consistency. [1] [2]