-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
75 lines (62 loc) · 2.63 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
alert("Your Akan name is, " + akanName + ".");
var akanName = function akanName (YY, MM, DD, g){
var daysOfTheWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var maleAkanName = ["Kwasi", "Kwadwo", "Kwabena", "Kwaku", "Yaw", "Kofi", "Kwame"];
var femaleAkanName = ["Akosua", "Adwoa", "Abenaa", "Akua", "Yaa", "Afua", "Ama"];
var YY = "Year"();
var MM = "Month"();
var DD = "Date"();
var g = "Gender"();
var d = newDate(YY, MM, DD);
var g = $("input:radio[name=Gender]:checked").val();
var result = akanName[YY, MM, DD, g];
if (g === "Female") {
return alert(d && femaleAkanName [d.getDay()]);
}
else {
return alert (d && maleAkanName[d.getDay()]);
}
}
//Frontend or User Interface
(document).ready(function() {
("#form").submit(function(event)
{
function generateAkan (){
}
event.preventDefault();
var YY = "Year"();
var MM = "Month"();
var DD = "Date"();
var g = "Gender"();
var d = newDate(YY, MM, DD);
// var YY = parseInt(('#Year').val());
// var MM = parseInt(('#Month').val());
// var DD = parseInt(('#Date').val());
var g = $("input:radio[name=Gender]:checked").val();
var result = akanName[YY, MM, DD, g];
alert("Your Ghanaian Akan Name is", + result);
});
// // On refreshing the form
document.getElementById("AkanNameGeneratorForm").reset();
});
// Backend
// Create an Array for the Male & Female names, as well as the days of the week
YY = year; MM = month; DD = day; g = Gender; d = newDate
var daysOfTheWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var maleAkanName = ["Kwasi", "Kwadwo", "Kwabena", "Kwaku", "Yaw", "Kofi", "Kwame"];
var femaleAkanName = ["Akosua", "Adwoa", "Abenaa", "Akua", "Yaa", "Afua", "Ama"];
var CC = Year.slice(0, 1);
var YY = Year.slice(2, 3)
var MM = "Month"();
var DD = "Date"
var g = "Gender"
var genderNew = gender.toLowerCase();//to convert input gender to lower case
var daysOfTheWeek = newDate
var akanName = function (YY, MM, DD, g) {
[maleAkanName]; [femaleAkanName];
}
if (g === "Female") {
alert (d && femaleAkanName[d.getDay()]);
}
else
alert(d && maleAkanName[d.getDay()]);