P
Prisma•8mo ago
sommeeeR

Get the next date with prisma

const course = await db.course.findFirst({
where: {
slug: params.slug,
},
include: {
courseDate: { // i want the next one from NOW
orderBy: {
from: 'asc',
}
},
},
});
const course = await db.course.findFirst({
where: {
slug: params.slug,
},
include: {
courseDate: { // i want the next one from NOW
orderBy: {
from: 'asc',
}
},
},
});
guys i want to get next courseDate from today and only that one. how can i do that using this query? 🙂
6 Replies
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
sommeeeR
sommeeeROP•8mo ago
ok. any particular reason to use .toUTCString()?
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
sommeeeR
sommeeeROP•8mo ago
i do, but isnt new Date() enough? under the hood its just a timestamp since epoch
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
sommeeeR
sommeeeROP•8mo ago
alright:) thanks!
Want results from more Discord servers?
Add your server