---
schema_version: "1"
id: f46e0c2d7634e3620c9c58cc3af714cf3892d85f074b86b803ff08d810a0790f
title: isAfter()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/ref-jsapi/ref-jsapi-auralocalizationservice-isafter.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-isafter.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 201a52fa194737cd8b8367a89b7c524fd443ccd4912d70af1e31a7aeb0ac17ad
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# isAfter()

Checks if `date1` is after `date2`.

## Signature

`isAfter(string | number | Date date1, string | number | Date date2, string unit)`

## Parameters

**_date1_:** Type: `string | number | Date`. A datetime string in ISO8601 format, or a timestamp in milliseconds, or a `Date` object.

**_date2_:** Type: `string | number | Date`. A datetime string in ISO8601 format, or a timestamp in milliseconds, or a `Date` object.

**_unit_:** Type: `string`. A datetime unit. Options are 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.

## Returns

**Type: `boolean`**

Returns `true` if `date1` is after `date2`, or `false` otherwise.

## Sample Code

```javascript
var date = new Date();
var day = $A.localizationService.endOf(date, 'day');
// Returns false, since date is before day
$A.localizationService.isAfter(date, day);
```

