This commit is contained in:
Christopher Cookman 2024-06-11 15:31:01 -06:00
parent 331cf5d172
commit a7f1687588
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -1321,10 +1321,10 @@ dcClient.on('interactionCreate', async interaction => {
break;
case "cdr": // Get CDR records for the user
// default to beginning of time
let userStartDate = interaction.options.getString("start_date").match(/^\d{2}\/\d{2}\/\d{4}$/)[0] // regex this to mm/dd/yyyy
let userEndDate = interaction.options.getString("end_date").match(/^\d{2}\/\d{2}\/\d{4}$/)[0] // regex this to mm/dd/yyyy
let startDate = new Date(userStartDate) || new Date(0);
let endDate = new Date(userEndDate) || new Date();
let userStartDate = interaction.options.getString("start_date")?.match(/^\d{2}\/\d{2}\/\d{4}$/)?.[0] || new Date(0); // regex this to mm/dd/yyyy
let userEndDate = interaction.options.getString("end_date")?.match(/^\d{2}\/\d{2}\/\d{4}$/)?.[0] || new Date(); // regex this to mm/dd/yyyy
let startDate = new Date(userStartDate);
let endDate = new Date(userEndDate);
await interaction.deferReply({
ephemeral: true
});