001    /**
002     * Implements the Cold Fusion Function monthasstring
003     */
004    package railo.runtime.functions.string;
005    
006    import railo.runtime.PageContext;
007    import railo.runtime.exp.ExpressionException;
008    import railo.runtime.ext.function.Function;
009    
010    public final class MonthShortAsString implements Function {
011            public static String call(PageContext pc , double month) throws ExpressionException {
012                    switch((int) month) {
013                            case 1: return "Jan";
014                            case 2: return "Feb";
015                            case 3: return "Mar";
016                            case 4: return "Apr";
017                            case 5: return "May";
018                            case 6: return "Jun";
019                            case 7: return "Jul";
020                            case 8: return "Aug";
021                            case 9: return "Sep";
022                            case 10: return "Oct";
023                            case 11: return "Nov";
024                            case 12: return "Dec";
025                            default: throw new ExpressionException("invalid month definition in function monthShortAsString, must be between 1 and 12 now ["+month+"]");
026                    }
027            
028            }
029    }