Skip to content

Commit

Permalink
Merge pull request #211 from BoomTech-LLC/staging
Browse files Browse the repository at this point in the history
Staging->main
  • Loading branch information
Tigran0199 authored Oct 30, 2024
2 parents 8c67866 + 66530a6 commit 0edf130
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boomform-builder",
"version": "2.5.7",
"version": "2.5.8",
"description": "Simple Form Builder",
"author": "BoomTechLLC",
"license": "MIT",
Expand Down
14 changes: 9 additions & 5 deletions src/Body/Fields/Date/Date.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react'
import dayjs from 'dayjs'
import { Input } from 'boomform'
import { iphoneCheck } from '../../../Helpers/global'
import dayjs from 'dayjs'

const Date = ({ validation = {}, payment, ...props }) => {
const { min, max, hideDays, disableDates, hiddenCustomDays, isCustom } =
validation
const { min, max, disableDates } = validation
if (min || max || disableDates) {
const { hideDays, hiddenCustomDays = [], isCustom } = validation
validation = {
...validation,
custom: value => {
Expand All @@ -15,16 +15,20 @@ const Date = ({ validation = {}, payment, ...props }) => {
const customDay = dayjs(value).format('MMM D, YYYY')
if (min?.value > value) return min?.msg
if (max?.value < value) return max?.msg
if (disableDates && hideDays[dayName] && !isCustom) {
if (disableDates && !isCustom && hideDays[dayName]) {
return `${dayName}s are disabled. Please pick another date. `
}
if (disableDates && hiddenCustomDays.includes(value) && isCustom) {
if (disableDates && isCustom && hiddenCustomDays.includes(value)) {
return `${customDay} is disabled. Please pick another date.`
}
}
return false
}
}
delete validation.hideDays
delete validation.disableDates
delete validation.hiddenCustomDays
delete validation.isCustom
}

const handleChange = ({ event }) => {
Expand Down
9 changes: 4 additions & 5 deletions src/Body/Fields/Phone/Phone.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ const Phone = ({
label,
classnameprefix,
id,
defaultCountryCode ='AF',
defaultCountryCode = 'AF',
payment,
...props
}) => {

return (
<>
<DropDown id={id} defaultCountryCode={defaultCountryCode} />
<Input
id={`${id}.phone`}
{...props}
type="phone"
name="phone"
autocomplete="tel"
type='phone'
name='phone'
autoComplete='tel'
/>
</>
)
Expand Down

0 comments on commit 0edf130

Please sign in to comment.