changed convertTime. made two functions ('organizedDate' && 'clockSpl…#372
Open
TalMoshel1 wants to merge 1 commit intomatas70:masterfrom
Open
changed convertTime. made two functions ('organizedDate' && 'clockSpl…#372TalMoshel1 wants to merge 1 commit intomatas70:masterfrom
TalMoshel1 wants to merge 1 commit intomatas70:masterfrom
Conversation
…it'} wich invoked inside convertTime
NoamGaash
requested changes
Apr 27, 2022
| // 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') |
Collaborator
There was a problem hiding this comment.
לא רלוונטי להשתמש בprompt, בייחוד לא בפונקציה כזו זניחה
אפשר להניח שהפורמט mm.dd.yyyy לא יהיה בשימוש כי אנחנו לא אמריקנים
| var realTime = new Date(year, month - 1, day, hours, minutes); | ||
| } | ||
|
|
||
| return realTime; |
| return realTime; | ||
| } | ||
| if (organizedTime.length === 3){ | ||
| const hours = organizedTime[0]; |
Collaborator
There was a problem hiding this comment.
יש הרבה קוד שחוזר על עצמו
מה שאפשר להוציא מif - כדאי
Author
|
תודה נעם, אגש לזה מחר בבוקר.
בתאריך יום ד׳, 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:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…it'} wich invoked inside convertTime