Skip to content

Commit

Permalink
remove moment dependency from funnel scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
tobeyadr committed Dec 18, 2024
1 parent f9da2d7 commit 44796b6
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 141 deletions.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ You can purchase a premium plan for access to support and our premium extensions

= 3.7.3.1 (2024-12-17) =
* ADDED Proper Locale filter for selecting languages.
* FIXED Broadcast scheduler limiting send time based on browser timezone rather than site timezone.
* FIXED New sanitization for custom properties not saving multiple selections for dropdowns.

= 3.7.3 (2024-12-04) =
Expand Down
35 changes: 14 additions & 21 deletions assets/js/admin/features/send-broadcast.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
( function ($) {

const {
modal,
select,
stepNav,
stepNavHandler,
input,
errorDialog,
setFrameContent,
progressBar,
tooltip,
loadingDots,
adminPageURL,
bold,
toggle,
icons,
dialog,
} = Groundhogg.element
const {
emailPicker,
searchesPicker,
} = Groundhogg.pickers
const {
emails : EmailsStore,
searches : SearchesStore,
Expand All @@ -35,8 +20,6 @@
const { createFilters } = Groundhogg.filters.functions
const {
formatNumber,
formatTime,
formatDate,
formatDateTime,
} = Groundhogg.formatting
const {
Expand All @@ -49,6 +32,12 @@
_n,
} = wp.i18n

const {
isInTheFuture,
getDate,
date,
} = wp.date

const {
Div,
Button,
Expand Down Expand Up @@ -78,8 +67,8 @@
searchMethod : 'filters', // 'filters' or 'search'
searchMethods : [],
totalContacts : 0,
date : moment().format('YYYY-MM-DD'),
time : moment().add(1, 'hour').format('HH:00:00'),
date : date('Y-m-d'),
time : date('H:00:00', getDate().setHours(getDate().getHours() + 1)),
broadcast : null,
segment_type : 'fixed',
batching : false,
Expand Down Expand Up @@ -553,7 +542,7 @@
id : 'send-date',
name : 'date',
value : getState().date || '',
min : moment().format('YYYY-MM-DD'),
min : date('Y-m-d'),
onChange: e => setState({
date: e.target.value,
}),
Expand All @@ -567,6 +556,10 @@
time: e.target.value,
}),
}),
Button({
className: 'gh-button grey small',
disabled: true,
}, wp.date.getSettings().timezone.abbr )
]) : null,
getState().when === 'later' ? Div({
className: 'display-flex gap-10 align-center',
Expand Down Expand Up @@ -672,7 +665,7 @@
Button({
id : 'go-to-contacts',
className: 'gh-button primary',
disabled : getState().when === 'later' && moment().isAfter(`${ getState().date } ${ getState().time }`),
disabled : getState().when === 'later' && !isInTheFuture(`${ getState().date } ${ getState().time }`),
style : {
alignSelf: 'flex-end',
},
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/features/send-broadcast.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 44796b6

Please sign in to comment.