Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Developing Applications > Developing XPage Applications > Developing XPage Applications for Notes Client > NotesDateRange sample JavaScript code for XPages
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

NotesName sample JavaScript code for XPages

Here is sample JavaScript code for the class NotesName. Eventually this sample code will find its way into the documentation. Corrections and comments are appreciated.

NotesMIMEEntity sample JavaScript code for XPages

Here is sample JavaScript code for the class NotesMIMEEntity. Eventually this sample code will find its way into the documentation. Corrections and comments are appreciated.

NotesViewEntryCollection sample JavaScript code for XPages

Here is sample JavaScript code for the class NotesViewEntryCollection. Eventually this sample code will find its way into the documentation. Corrections and comments are appreciated.

NotesViewNavigator sample JavaScript code for XPages

Here is sample JavaScript code for the class NotesViewNavigator. Eventually this sample code will find its way into the documentation. Corrections and comments are appreciated.

NotesViewEntry sample JavaScript code for XPages

Here is sample JavaScript code for the class NotesViewEntry. Eventually this sample code will find its way into the documentation. Corrections and comments are appreciated.
Community articleNotesDateRange sample JavaScript code for XPages
Added by ~Elizabeth Umkroskiettu | Edited by ~Elizabeth Umkroskiettu on December 29, 2010 | Version 2
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
Here is sample JavaScript code for the class NotesDateRange. Eventually this sample code will find its way into the documentation. Corrections and comments are appreciated.
This computed field creates a date-time range from two date-time values and returns its text value.

var doc:NotesDocument = currentDocument.getDocument();
var created:NotesDateTime = doc.getCreated();
var last:NotesDateTime = doc.getLastAccessed();
var range:NotesDateRange = session.createDateRange(created, last);
return "Life span of this document: " + range.getText()


This computed field creates a date-time range, sets its start and end values from two date-time values, and returns its text value.

var doc:NotesDocument = currentDocument.getDocument();
var created:NotesDateTime = doc.getCreated();
var last:NotesDateTime = doc.getLastAccessed();
var range:NotesDateRange = session.createDateRange();
range.setStartDateTime(created);
range.setEndDateTime(last);
return "Life span of this document: " + range.getText()


This computed field creates a date-time range from two Date values and returns its text value.

var doc:NotesDocument = currentDocument.getDocument();
var created:Date = doc.getCreated().toJavaDate();
var last:Date = doc.getLastAccessed().toJavaDate();
var range:NotesDateRange = session.createDateRange(created, last);
return "Life span of this document: " + range.getText()


This computed field creates a date-time range, sets its text value, and returns dates based on its start and end values. Also returned is the common name of the parent session.

var doc:NotesDocument = currentDocument.getDocument();
var created:string = doc.getCreated().getLocalTime();
var last:string = doc.getLastAccessed().getLocalTime();
var range:NotesDateRange = session.createDateRange();
range.setText(created + " - " + last);
return "Created on " + 	range.getStartDateTime().getDateOnly() +
	", last accessed on " + range.getEndDateTime().getDateOnly() +
	", current user " + range.getParent().getCommonUserName()

  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (2)
collapsed Versions (2)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (2)Dec 29, 2010, 7:31:49 PM~Elizabeth Umkroskiettu  
1Dec 29, 2010, 7:25:47 PM~Ben Eljipypulettu  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility