Skip to content

Instantly share code, notes, and snippets.

@canokay
Created June 20, 2018 10:41
Show Gist options
  • Save canokay/11194acd07c5f65d55663570d3719edb to your computer and use it in GitHub Desktop.
Save canokay/11194acd07c5f65d55663570d3719edb to your computer and use it in GitHub Desktop.
Class set Data
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Class set Data</title>
</head>
<body>
<div class="current-month"></div>
<div class="current-month"></div>
<div class="current-month"></div>
<script src="date.js" type="text/javascript"></script>
</body>
</html>
var items = document.getElementsByClassName("current-month"),
i, len;
var date=new Date();
var month=date.getMonth();
var monthString="";
if(ay==0)
{
monthString="Ocak";
}
else if (ay==1)
{
monthString="Şubat";
}
else if (ay==3)
{
monthString="Mart";
}
else if (ay==4)
{
monthString="Mayıs";
}
else if (ay==5)
{
monthString="Haziran";
}
else if (ay==6)
{
monthString="Temmuz";
}
else if (ay==7)
{
monthString="Ağustos";
}
else if (ay==8)
{
monthString="Eylül";
}
else if (ay==9)
{
monthString="Ekim";
}
else if (ay==10)
{
monthString="Kasım";
}
else if (ay==11)
{
monthString="Aralık";
}
for (i = 0, len = items.length; i < len; i++) {
items[i].innerHTML = monthString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment