Subversion Repositories DevTools

Rev

Rev 64 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'=============================================================
'//
'//                                     Formater
'//
'// version:            0.2
'//     last modified:  15-Sep-2004 13:38 by Sasha Vukovic
'=============================================================
%>
<%
Class Formater
        '-----------------------------------------------------------------------------------------------------------------
        Public Function FormatDate ( sDate, nType )
                Dim mDay, mMonth, mYear
                
                If (sDate = "") OR IsNull(sDate) Then Exit Function
                
                Call SplitDate ( sDate, mDay, mMonth, mYear )
                
                Select Case nType
                        Case 1
                                ' Jan, 26 2003
                                'Response.write "MONTH"& mMonth &" "& sDate
                                FormatDate = MonthName ( mMonth, TRUE ) &", "&  mDay &" "& mYear
                                
                End Select
                
        End Function
        '-----------------------------------------------------------------------------------------------------------------
        Private Sub SplitDate ( sDate, ByRef outDay, ByRef outMonth, ByRef outYear )
                outDay   = DatePart ( "D", DateValue ( sDate ) )
                outMonth = DatePart ( "M", DateValue ( sDate ) )
                outYear  = DatePart ( "YYYY", DateValue ( sDate ) )
                
        End Sub
        '-----------------------------------------------------------------------------------------------------------------
        Public Function TextToHTML ( sString )
                Dim mString
                
                If (sString = "") OR IsNull(sString) Then Exit Function
                
                mString = Server.HTMLEncode( sString )
                mString = Replace(mString, VBNewLine, "<br>")
                
                TextToHTML = mString
        End Function
        '-----------------------------------------------------------------------------------------------------------------
        Private Sub Class_Initialize()
                '// Perform action on creation of object. e.g. Set myObj = New ThisClassName
        End Sub
        '-----------------------------------------------------------------------------------------------------------------
        Private Sub Class_Terminate()
                '// Perform action on object disposal. e.g. Set myObj = Nothing
        End Sub
        '-----------------------------------------------------------------------------------------------------------------
End Class
%>