1 40 package org.dspace.app.webui.jsptag; 41 42 import java.io.IOException ; 43 44 import javax.servlet.jsp.JspException ; 45 import javax.servlet.jsp.tagext.TagSupport ; 46 47 import org.dspace.app.webui.util.UIUtil; 48 import org.dspace.content.DCDate; 49 50 57 public class DateTag extends TagSupport 58 { 59 60 private DCDate date; 61 62 63 private boolean displayTime = true; 64 65 70 public DCDate getDate() 71 { 72 return date; 73 } 74 75 81 public void setDate(DCDate d) 82 { 83 date = d; 84 } 85 86 91 public String getNotime() 92 { 93 return (displayTime ? "false" : "true"); 95 } 96 97 103 public void setNotime(String dummy) 104 { 105 displayTime = false; 106 } 107 108 public int doStartTag() throws JspException 109 { 110 String toDisplay = UIUtil.displayDate(date, displayTime, true); 111 112 try 113 { 114 pageContext.getOut().print(toDisplay); 115 } 116 catch (IOException ie) 117 { 118 throw new JspException (ie); 119 } 120 121 return SKIP_BODY; 122 } 123 } 124 | Popular Tags |