-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changed convertTime. made two functions ('organizedDate' && 'clockSpl… #372
base: master
Are you sure you want to change the base?
Conversation
…it'} wich invoked inside convertTime
// console.log(dateString, timeString) | ||
let organizedArray = []; | ||
let dateSplit = dateString.split(".") | ||
let a = prompt('if you write date in month-day-year format - write 0. if you write date in day-month-year format - write 1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
לא רלוונטי להשתמש בprompt, בייחוד לא בפונקציה כזו זניחה
אפשר להניח שהפורמט mm.dd.yyyy
לא יהיה בשימוש כי אנחנו לא אמריקנים
var realTime = new Date(year, month - 1, day, hours, minutes); | ||
} | ||
|
||
return realTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
לא חסר .getTime()
?,
return realTime; | ||
} | ||
if (organizedTime.length === 3){ | ||
const hours = organizedTime[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
יש הרבה קוד שחוזר על עצמו
מה שאפשר להוציא מif - כדאי
תודה נעם, אגש לזה מחר בבוקר.
בתאריך יום ד׳, 27 באפר׳ 2022, 22:31, מאת NoamGaash <
***@***.***>:
… ***@***.**** requested changes on this pull request.
------------------------------
In js/functions.js
<#372 (comment)>:
> @@ -374,24 +374,71 @@ function getCurrentTime() {
return now.getTime();
}
+
+function organizedDate(dateString) {
+ // let invalid = 'this date is invalid: '
+// console.log(dateString, timeString)
+ let organizedArray = [];
+ let dateSplit = dateString.split(".")
+ let a = prompt('if you write date in month-day-year format - write 0. if you write date in day-month-year format - write 1')
לא רלוונטי להשתמש בprompt, בייחוד לא בפונקציה כזו זניחה
אפשר להניח שהפורמט dd.mm.yyyy לא יהיה בשימוש כי אנחנו לא אמריקנים
------------------------------
In js/functions.js
<#372 (comment)>:
> + const year = organizeddateString[2];
+ const month = organizeddateString[1];
+ const day = organizeddateString[0];
+
+ const organizedTime = clockSplit(timeString)
+ if (organizedTime.length === 2) {
+ const hours = organizedTime[0];
+ const minutes = organizedTime[1];
+
+ if ($.urlParam("ff") === "true") { // האם הפונקציה תמיד צריכה לבדוק את ff ?
+ var realTime = new Date(year, month - 1, day, 0, hours, minutes / 60 * 1000);
+ } else {
+ var realTime = new Date(year, month - 1, day, hours, minutes);
+ }
+
+ return realTime;
לא חסר .getTime()?,
------------------------------
In js/functions.js
<#372 (comment)>:
> +
+ const organizedTime = clockSplit(timeString)
+ if (organizedTime.length === 2) {
+ const hours = organizedTime[0];
+ const minutes = organizedTime[1];
+
+ if ($.urlParam("ff") === "true") { // האם הפונקציה תמיד צריכה לבדוק את ff ?
+ var realTime = new Date(year, month - 1, day, 0, hours, minutes / 60 * 1000);
+ } else {
+ var realTime = new Date(year, month - 1, day, hours, minutes);
+ }
+
+ return realTime;
+ }
+ if (organizedTime.length === 3){
+ const hours = organizedTime[0];
יש הרבה קוד שחוזר על עצמו
מה שאפשר להוציא מif - כדאי
—
Reply to this email directly, view it on GitHub
<#372 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVI5XNF5L37WNOTPUDEMGUTVHGIXRANCNFSM5UGJ5KWQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…it'} wich invoked inside convertTime