fix: add translate function to book appointment index.js
This commit is contained in:
parent
e683cccf35
commit
728ef46048
@ -69,7 +69,7 @@ function on_date_or_timezone_select() {
|
|||||||
window.selected_timezone = timezone.value;
|
window.selected_timezone = timezone.value;
|
||||||
update_time_slots(date_picker.value, timezone.value);
|
update_time_slots(date_picker.value, timezone.value);
|
||||||
let lead_text = document.getElementById('lead-text');
|
let lead_text = document.getElementById('lead-text');
|
||||||
lead_text.innerHTML = "Select Time"
|
lead_text.innerHTML = __("Select Time")
|
||||||
}
|
}
|
||||||
|
|
||||||
async function get_time_slots(date, timezone) {
|
async function get_time_slots(date, timezone) {
|
||||||
@ -89,7 +89,7 @@ async function update_time_slots(selected_date, selected_timezone) {
|
|||||||
clear_time_slots();
|
clear_time_slots();
|
||||||
if (window.slots.length <= 0) {
|
if (window.slots.length <= 0) {
|
||||||
let message_div = document.createElement('p');
|
let message_div = document.createElement('p');
|
||||||
message_div.innerHTML = "There are no slots available on this date";
|
message_div.innerHTML = __("There are no slots available on this date");
|
||||||
timeslot_container.appendChild(message_div);
|
timeslot_container.appendChild(message_div);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ function get_slot_layout(time) {
|
|||||||
let start_time_string = moment(time).tz(timezone).format("LT");
|
let start_time_string = moment(time).tz(timezone).format("LT");
|
||||||
let end_time = moment(time).tz(timezone).add(window.appointment_settings.appointment_duration, 'minutes');
|
let end_time = moment(time).tz(timezone).add(window.appointment_settings.appointment_duration, 'minutes');
|
||||||
let end_time_string = end_time.format("LT");
|
let end_time_string = end_time.format("LT");
|
||||||
return `<span style="font-size: 1.2em;">${start_time_string}</span><br><span class="text-muted small">to ${end_time_string}</span>`;
|
return `<span style="font-size: 1.2em;">${start_time_string}</span><br><span class="text-muted small">${__("to") } ${end_time_string}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_time() {
|
function select_time() {
|
||||||
@ -227,9 +227,9 @@ async function submit() {
|
|||||||
},
|
},
|
||||||
callback: (response)=>{
|
callback: (response)=>{
|
||||||
if (response.message.status == "Unverified") {
|
if (response.message.status == "Unverified") {
|
||||||
frappe.show_alert("Please check your email to confirm the appointment")
|
frappe.show_alert(__("Please check your email to confirm the appointment"))
|
||||||
} else {
|
} else {
|
||||||
frappe.show_alert("Appointment Created Successfully");
|
frappe.show_alert(__("Appointment Created Successfully"));
|
||||||
}
|
}
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
let redirect_url = "/";
|
let redirect_url = "/";
|
||||||
@ -239,7 +239,7 @@ async function submit() {
|
|||||||
window.location.href = redirect_url;},5000)
|
window.location.href = redirect_url;},5000)
|
||||||
},
|
},
|
||||||
error: (err)=>{
|
error: (err)=>{
|
||||||
frappe.show_alert("Something went wrong please try again");
|
frappe.show_alert(__("Something went wrong please try again"));
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user