@@ -209,6 +209,15 @@ export class Daytime implements Types.IDaytime {
209209 return Helpers . isDST ( this . date )
210210 }
211211
212+ /**
213+ * Checks if this date is in the future (after today).
214+ * @returns True if this date is in the future, false otherwise
215+ */
216+ isFuture ( ) : boolean {
217+ const now = new Date ( )
218+ return Utils . isAfter ( this . date , now )
219+ }
220+
212221 /**
213222 * Checks if the year of the date is a leap year.
214223 * @returns True if the year is a leap year, false otherwise
@@ -217,6 +226,15 @@ export class Daytime implements Types.IDaytime {
217226 return Helpers . isLeapYear ( this . date )
218227 }
219228
229+ /**
230+ * Checks if this date is in the past (before today).
231+ * @returns True if this date is in the past, false otherwise
232+ */
233+ isPast ( ) : boolean {
234+ const now = new Date ( )
235+ return Utils . isBefore ( this . date , now )
236+ }
237+
220238 /**
221239 * Checks if this date is the same as another date.
222240 * @param other - The other date to compare with
@@ -228,6 +246,24 @@ export class Daytime implements Types.IDaytime {
228246 return Utils . isSame ( this . date , otherDate , unit )
229247 }
230248
249+ /**
250+ * Checks if this date is the same day as another date.
251+ * @param other - The other date to compare with
252+ * @returns True if dates are on the same day, false otherwise
253+ */
254+ isSameDay ( other : Types . DateInput ) : boolean {
255+ return this . isSame ( other , 'day' )
256+ }
257+
258+ /**
259+ * Checks if this date is the same month as another date.
260+ * @param other - The other date to compare with
261+ * @returns True if dates are in the same month, false otherwise
262+ */
263+ isSameMonth ( other : Types . DateInput ) : boolean {
264+ return this . isSame ( other , 'month' )
265+ }
266+
231267 /**
232268 * Checks if this date is the same as or after another date.
233269 * @param other - The other date to compare with
@@ -250,6 +286,88 @@ export class Daytime implements Types.IDaytime {
250286 return Utils . isSameOrBefore ( this . date , otherDate , unit )
251287 }
252288
289+ /**
290+ * Checks if this date is the same quarter as another date.
291+ * @param other - The other date to compare with
292+ * @returns True if dates are in the same quarter, false otherwise
293+ */
294+ isSameQuarter ( other : Types . DateInput ) : boolean {
295+ return this . isSame ( other , 'quarter' )
296+ }
297+
298+ /**
299+ * Checks if this date is the same week as another date.
300+ * @param other - The other date to compare with
301+ * @returns True if dates are in the same week, false otherwise
302+ */
303+ isSameWeek ( other : Types . DateInput ) : boolean {
304+ return this . isSame ( other , 'week' )
305+ }
306+
307+ /**
308+ * Checks if this date is the same year as another date.
309+ * @param other - The other date to compare with
310+ * @returns True if dates are in the same year, false otherwise
311+ */
312+ isSameYear ( other : Types . DateInput ) : boolean {
313+ return this . isSame ( other , 'year' )
314+ }
315+
316+ /**
317+ * Checks if this date is in the current month.
318+ * @returns True if this date is in the current month, false otherwise
319+ */
320+ isThisMonth ( ) : boolean {
321+ const now = new Date ( )
322+ return this . isSame ( now , 'month' )
323+ }
324+
325+ /**
326+ * Checks if this date is in the current quarter.
327+ * @returns True if this date is in the current quarter, false otherwise
328+ */
329+ isThisQuarter ( ) : boolean {
330+ const now = new Date ( )
331+ return this . isSame ( now , 'quarter' )
332+ }
333+
334+ /**
335+ * Checks if this date is in the current week.
336+ * @returns True if this date is in the current week, false otherwise
337+ */
338+ isThisWeek ( ) : boolean {
339+ const now = new Date ( )
340+ return this . isSame ( now , 'week' )
341+ }
342+
343+ /**
344+ * Checks if this date is in the current year.
345+ * @returns True if this date is in the current year, false otherwise
346+ */
347+ isThisYear ( ) : boolean {
348+ const now = new Date ( )
349+ return this . isSame ( now , 'year' )
350+ }
351+
352+ /**
353+ * Checks if this date is today.
354+ * @returns True if this date is today, false otherwise
355+ */
356+ isToday ( ) : boolean {
357+ const now = new Date ( )
358+ return this . isSame ( now , 'day' )
359+ }
360+
361+ /**
362+ * Checks if this date is tomorrow.
363+ * @returns True if this date is tomorrow, false otherwise
364+ */
365+ isTomorrow ( ) : boolean {
366+ const tomorrow = new Date ( )
367+ tomorrow . setDate ( tomorrow . getDate ( ) + 1 )
368+ return this . isSame ( tomorrow , 'day' )
369+ }
370+
253371 /**
254372 * Checks if the date is valid.
255373 * @returns True if the date is valid, false otherwise
@@ -274,6 +392,16 @@ export class Daytime implements Types.IDaytime {
274392 return Helpers . isWeekend ( this . date )
275393 }
276394
395+ /**
396+ * Checks if this date is yesterday.
397+ * @returns True if this date is yesterday, false otherwise
398+ */
399+ isYesterday ( ) : boolean {
400+ const yesterday = new Date ( )
401+ yesterday . setDate ( yesterday . getDate ( ) - 1 )
402+ return this . isSame ( yesterday , 'day' )
403+ }
404+
277405 /**
278406 * Gets the ISO week number (1-53).
279407 * @returns The ISO week number (1-53)
0 commit comments