import * as React from 'react' ; import styles from './sharePointComponents.module.scss' ; import { FieldComponent , IFieldComponentProps , IFieldComponentState } from './FieldComponent' ; import UserInterfaceUtility from './UserInterfaceUtility' ; export interface IItemDateFieldDisplayProps extends IFieldComponentProps { } export interface IItemDateFieldDisplayState extends IFieldComponentState { } export default class ItemDateFieldDisplay extends FieldComponent < IItemDateFieldDisplayProps , IItemDateFieldDisplayState > { public constructor ( props ) { super ( props ) ; } public render ( ) { let dateVal = "" ; if ( this . value != null ) { let date = new Date ( this . value ) as Date ; if ( date != null ) { dateVal = UserInterfaceUtility . getFriendlyDate ( date ) ; } } return ( < div className = { styles . sharePointComponent } > { dateVal } < /div>); } }