JSDoc: Class: DateColumn

# Class: DateColumn

## FooTable.DateColumn

#### new DateColumn(instance, definition) → {FooTable.DateColumn}

The date column class is used to handle date values. This column is dependent on moment.js to provide date parsing and formatting functionality.

##### Parameters:

Name | Type | Description
--- | --- | ---
`instance` | FooTable.Table | The parent `FooTable.Table` this column belongs to.
`definition` | object | An object containing all the properties to set for the column.

##### Returns:

Type
  FooTable.DateColumn

### Extends

- FooTable.Column

### Members

#### (readonly) $el :jQuery

The jQuery cell object for the column header.

##### Type:

- jQuery

Inherited From:
  - FooTable.Column#$el

#### classes :Array.<string>

The classes to apply to all cells in this column.

##### Type:

- Array.<string>

Inherited From:
  - FooTable.Column#classes

#### formatString :string

The format string to use when parsing and formatting dates.

##### Type:

- string

#### (readonly) ft :FooTable.Table

The root `FooTable.Table` for the column.

##### Type:

- FooTable.Table

Inherited From:
  - FooTable.Column#ft

#### hidden :boolean

Whether or not this column is hidden from view and appears in the details row.

##### Type:

- boolean

Inherited From:
  - FooTable.Column#hidden
Default Value:
  - false

#### (readonly) index :number

The index of the column in the table. This is set by the plugin during initialization.

##### Type:

- number

Inherited From:
  - FooTable.Column#index
Default Value:
  - -1

#### name :string

The name of the column. This name must correspond to the property name of the JSON row data.

##### Type:

- string

Inherited From:
  - FooTable.Column#name
Default Value:
  - null

#### style :object

The styles to apply to all cells in this column.

##### Type:

- object

Inherited From:
  - FooTable.Column#style

#### title :string

The title to display in the column header, this can be HTML.

##### Type:

- string

Inherited From:
  - FooTable.Column#title
Default Value:
  - null

#### (readonly) type :string

The type of data displayed by the column.

##### Type:

- string

Inherited From:
  - FooTable.Column#type

#### (readonly) virtual :boolean

Whether or not the column was parsed from a standard table row containing data instead of from an actual header row.

##### Type:

- boolean

Inherited From:
  - FooTable.Column#virtual

#### visible :boolean

Whether or not this column is completely hidden from view and will not appear in the details row.

##### Type:

- boolean

Inherited From:
  - FooTable.Column#visible
Default Value:
  - true

### Methods

#### (static) filterValue(valueOrElement) → {string}

This is supplied either the cell value or jQuery object to parse. A string value must be returned from this method and will be used during filtering operations.

##### This:

- FooTable.DateColumn

##### Parameters:

Name | Type | Description
--- | --- | ---
`valueOrElement` | * | jQuery | The value or jQuery cell object.

##### Returns:

Type
  string

#### (protected) $create()

After the column has been defined this ensures that the $el property is a jQuery object by either creating or updating the current value.

##### This:

- FooTable.Column

Inherited From:
  - FooTable.Column#$create

#### (protected) createCell(row) → {FooTable.Cell}

Creates a cell for this column from the supplied `FooTable.Row` object. This allows different column types to return different types of cells.

##### This:

- FooTable.Column

##### Parameters:

Name | Type | Description
--- | --- | ---
`row` | FooTable.Row | The row to create the cell from.

Inherited From:
  - FooTable.Column#createCell

##### Returns:

Type
  FooTable.Cell

#### (protected) define(definition)

This is supplied the column definition in the form of a simple object created by merging options supplied via the plugin constructor with those parsed from the DOM.

##### This:

- FooTable.Column

##### Parameters:

Name | Type | Description
--- | --- | ---
`definition` | object | The object containing the column definition.

Inherited From:
  - FooTable.Column#define

#### (protected) formatter(value) → {string|HTMLElement|jQuery}

This is supplied the value retrieved from the `FooTable.DateColumn#parser` function and must return a string, HTMLElement or jQuery object. The return value from this function is what is displayed in the cell in the table.

##### This:

- FooTable.DateColumn

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | * | The value to format.

Overrides:
  - FooTable.Column#formatter

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) parser(valueOrElement) → {moment|null}

This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the `FooTable.DateColumn#format` function to generate the cell contents.

##### This:

- FooTable.DateColumn

##### Parameters:

Name | Type | Description
--- | --- | ---
`valueOrElement` | * | jQuery | The value or jQuery cell object.

Overrides:
  - FooTable.Column#parser

##### Returns:

Type
  moment | null