Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to convert number into corresponding Month Name

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 796
    Comment on it

    Hello Everyone, In this article I am sharing how to display Month Name for corresponding number such as if we have month coming in number from server say(1, on) and we want to display January in place of 1, February in place of 2 and so on by angular.js. We can try this:

            {{user.birthDate}}, {{user.birthMonth | monthName}}
    phonecatApp.filter('monthName', [function() {
        return function (monthNumber) { //1 = January
            var monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June',
                'July', 'August', 'September', 'October', 'November', 'December' ];
            return monthNames[monthNumber - 1];

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: