BrightSide Workbench Full Report + Source Code
org.turro.elephant.util.DateFormats Class Reference

Static Public Member Functions

static final String format (Date d, boolean dateOnly)
 
static String formatNull (Date d, boolean dateOnly)
 
static String getDefaultFormat ()
 
static String getDefaultDateTimeFormat ()
 
static String monthName (Date date)
 
static String formatTime (Date d)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 31 of file DateFormats.java.

Member Function Documentation

◆ format()

static final String org.turro.elephant.util.DateFormats.format ( Date  d,
boolean  dateOnly 
)
static

Definition at line 33 of file DateFormats.java.

33  {
34  if(d == null) return null;
35  if(dateOnly) {
36  return org.amic.util.date.DateFormats.format(d,
37  DateFormat.SHORT, Application.getUsedLocale());
38  } else {
39  return org.amic.util.date.DateFormats.format(d,
40  DateFormat.SHORT, DateFormat.SHORT, Application.getUsedLocale());
41  }
42  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatNull()

static String org.turro.elephant.util.DateFormats.formatNull ( Date  d,
boolean  dateOnly 
)
static

Definition at line 44 of file DateFormats.java.

44  {
45  if(d == null) {
46  return "";
47  }
48  return DateFormats.format(d, dateOnly);
49  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatTime()

static String org.turro.elephant.util.DateFormats.formatTime ( Date  d)
static

Definition at line 78 of file DateFormats.java.

78  {
79  if(d == null) {
80  return "";
81  }
82  final DateFormat df = DateFormat.getTimeInstance(
83  DateFormat.SHORT, Application.getUsedLocale());
84  return df.format(d);
85  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultDateTimeFormat()

static String org.turro.elephant.util.DateFormats.getDefaultDateTimeFormat ( )
static

Definition at line 62 of file DateFormats.java.

62  {
63  final DateFormat df = DateFormat.getDateTimeInstance(
64  DateFormat.SHORT, DateFormat.SHORT, Application.getUsedLocale());
65  if (df instanceof SimpleDateFormat) {
66  final String fmt = ((SimpleDateFormat)df).toPattern();
67  if (fmt != null && !"M/d/yy h:mm a".equals(fmt))
68  return fmt; //note: JVM use "M/d/yy h:mm a" if not found!
69  }
70  return "yyyy/MM/dd hh:mm a";
71  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultFormat()

static String org.turro.elephant.util.DateFormats.getDefaultFormat ( )
static

Definition at line 51 of file DateFormats.java.

51  {
52  final DateFormat df = DateFormat.getDateInstance(
53  DateFormat.SHORT, Application.getUsedLocale());
54  if (df instanceof SimpleDateFormat) {
55  final String fmt = ((SimpleDateFormat)df).toPattern();
56  if (fmt != null && !"M/d/yy h:mm a".equals(fmt))
57  return fmt; //note: JVM use "M/d/yy h:mm a" if not found!
58  }
59  return "yyyy/MM/dd";
60  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ monthName()

static String org.turro.elephant.util.DateFormats.monthName ( Date  date)
static

Definition at line 73 of file DateFormats.java.

73  {
74  DateFormatSymbols dfs = DateFormatSymbols.getInstance(Application.getUsedLocale());
75  return dfs.getMonths()[new CheckDate(date).getMonth() - 1];
76  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: