Skip to main content link. Accesskey S

The useful resource for Titanium and YouAtNotes Domino To Go

Submit Search

Home > YouAtNotes Framework > YN: work with dates

YN: work with dates

ShowTable of Contents

Convert a datetime column value of a Notes View to a JavaScript date


In columns of Notes Views date or datetime values are represented as yyyymmdd or yyyymmddThhMMss strings.
Use this function to convert that into a JavaScript date or datetime object.

var mydate = notesViewHelper.columnValueToDate(columnvalue);

Format date


Use Date.format(mask) function with:

a) a custom mask

m: short month
mm: month
mmmm: long month
d: short day
dd: day
yy: short year
yyyy: year
h: hour (12h format)
hh: hour (24h format)
MM: minutes
ss: seconds
TT: timezone

b) pre-defined masks:

ynDateFormat.masks.default (ddd mmm dd yyyy HH:MM:ss)
ynDateFormat.masks.shortDate (m/d/yy)
ynDateFormat.masks.mediumDate (mmm d, yyyy)
ynDateFormat.masks.longDate (mmmm d, yyyy)
ynDateFormat.masks.fullDate (dddd, mmmm d, yyyy)
ynDateFormat.masks.shortTime (h:MM TT)
ynDateFormat.masks.mediumTime (h:MM:ss TT)
ynDateFormat.masks.longTime (h:MM:ss TT Z)
ynDateFormat.masks.isoDate (yyyy-mm-dd)
ynDateFormat.masks.isoTime (HH:MM:ss)
ynDateFormat.masks.isoDateTime (yyyy-mm-dd'T'HH:MM:ss)
ynDateFormat.masks.isoUtcDateTime (UTC:yyyy-mm-dd'T'HH:MM:ss'Z')

Example

var d = new Date();
var formattedDate = d.format(ynDateFormat.masks.longDate);


or

var d = new Date();
var formattedDate = ynDate.format(d, ynDate.masks.longDate);

Add Comment

Name:
Comments:
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.