简体   繁体   中英

toLocateString doesn't give me the correct output

toLocateString isn't working as intended, it should give me the long version of the month but instead it gives me just the number, i've tried to switch to the default and nothing changes

     data(){
        return{
            currentMonth: new Date().getMonth().toLocaleString("it-IT", { month: "short" }),
            
            days:['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
        }
    },

Just use:

Date().toLocaleString("it-IT", { month: "long" })

because new Date().getMonth() returns month index

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM