Skip to first unread message

Mohammed Khalaila

unread,
Aug 28, 2015, 10:33:32 PM8/28/15
to MIT App Inventor Forum
I got this kind of date format MMM d, yyyy and i need to get the day name in that date ... 

How can i do that ?


Taifun

unread,
Aug 29, 2015, 10:30:51 AM8/29/15
to MIT App Inventor Forum
what about using the Clock.DayOfMonth method together with Clock.Now?

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         



Mohammed Khalaila

unread,
Aug 29, 2015, 12:45:59 PM8/29/15
to mitappinv...@googlegroups.com
Hello there 

So What i exactly Need Is Getting the name using this Date -- > 2015,29 'אוג (Contains Different language [Depends on the device's language ...] )

So the only way i can use the block Clock.DayOfMonth is using an instant .. So i found the block Clock.MakeInstant But when i try to convert from date to instant i get this error .. 
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Argument to MakeInstant should have form MM/DD/YYYY hh:mm:ss, or MM/DD/YYYY or hh:mm
Note: You will not see another error reported for 5 seconds.
---------------------------------------------------------------------------------------------------------


So i decided to change the date form and it gave me the same error ... 

So what can i do to get the day name using this date ??\

LOOK IN THE PICTURE FOR THE BLOCKS ....




Thank you 

Taifun

unread,
Aug 29, 2015, 3:11:29 PM8/29/15
to MIT App Inventor Forum
what about that?


Taifun

Mohammed Khalaila

unread,
Aug 29, 2015, 3:39:50 PM8/29/15
to MIT App Inventor Forum
mm.. I'm sorry i think i sent the wrong picture ...

I have to store the date in a list and then when i need it get the day name

Taifun

unread,
Aug 29, 2015, 4:14:48 PM8/29/15
to mitappinv...@googlegroups.com
so how do you store the date in the list?
you could do it like this


Taifun

Mohammed Khalaila

unread,
Aug 30, 2015, 3:22:28 AM8/30/15
to MIT App Inventor Forum
Hello there

I'm Sorry i couldn't explain this well .... 

So i decided to write it all detailed ... 

So I'm Storing Dates (more Than one Date) for each person , I'm seperating each date with this char [ ` ] , And the dates for each person is a string for example --> 29 AUG',2015`30 AUG'2015` 
(These Dates are only for one person) and i'm Storing the dates for each person in a list that means i got a list with Strings And each String Contains All Dates for one person

This is just an example (in the comment in the picture) : 


So After storing the date , you go to home Screen you can click a button that shows You a list with each person's name , when click a name An other list opens and shows you each separate date  and what i want it to when click a date that is in the list it shows you the day name in that date -- But when i try doing it , it gives the error in the third post ...


Here is how I'm trying to do it



and this is How the list (A list of one Person's Dates) looks like 


And when you look at the list up in the picture you will notice the word "Dates" That is for identifying the list when i transfer from an other screen (I got lots of lists ...) ....


And i can't use millis instead for date because it will messed up in other stuff that i try doing ...


So i hope that i explained well this time :)







Taifun

unread,
Aug 30, 2015, 10:34:28 AM8/30/15
to MIT App Inventor Forum
I don't think you can get the weekday name from that "strange" date fomat, and for the MakeInstant block you need the format MM/DD/YYYY
but you could use a second list and store the date in milliseconds and later get the weekday name from there (see again my screenshot) or use a second list to store the weekday name
Taifun


Reply all
Reply to author
Forward
0 new messages