Name

global.UserLocaleUtil

Description

No description available

Script

var UserLocaleUtil = Class.create();

/**
* Note this class just exposes read only data for scoped apps.
**/
UserLocaleUtil.prototype = {
  type: 'UserLocaleUtil'
};


/**
* @return {String} the date format eg: yyyy-MM-dd
**/
UserLocaleUtil.getDateFormat = function() {
  return gs.getSession().getDateFormat();
};

/**
* @return {String} the datetime format eg: yyyy-MM-dd HH:mm:ss
**/
UserLocaleUtil.getDateTimeFormat = function() {
  return gs.getSession().getDateTimeFormat();
};

/**
* @return {String} the domain of the current user eg: global
**/
UserLocaleUtil.getDomainDisplayValue = function() {
  return gs.getUser().getDomainDisplayValue();
};

/**
* @return {String} the domaiID of the current user 
**/
UserLocaleUtil.getDomainID = function() {
  return gs.getUser().getDomainID();
};

/**
* @return {{"decimal_separator":String,"group_separator":String,"currency_symbol":String,"currency_code":String}} eg: {"decimal_separator":".","group_separator":",","currency_symbol":"£","currency_code":"GBP"
**/
UserLocaleUtil.getGlobalLocale = function() {
  return JSON.parse(new SNC.PlannedTaskAPI().getGlobalLocale());
};

/** 
* Flushes the error / info messages from the user session.  Added this method so that scoped apps could invoke flushMessage as it is not accessible from scoped app.
**/
UserLocaleUtil.flushMessagesFromSession = function() {
  gs.flushMessages();
};

Sys ID

9405395ec716201063e1e5e603c260a0

Offical Documentation

Official Docs: