You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by "Oliver Strässer (JIRA)" <ji...@apache.org> on 2009/12/16 13:11:18 UTC

[jira] Created: (CLEREZZA-37) Wish for Scala function

Wish for Scala function
-----------------------

                 Key: CLEREZZA-37
                 URL: https://issues.apache.org/jira/browse/CLEREZZA-37
             Project: Clerezza
          Issue Type: New Feature
            Reporter: Oliver Strässer


An short function to format Java Datetime, so that we don't need to type everytime this: 

{if((res/acp("startDate")).length > 0){
 var startDate = (res/acp("startDate")*);
   try {
     {startDate .substring(0, startDate .indexOf('T'))}
    } catch {
      case e:Exception => res/acp("startDate")*;
     }
    }else {
""
}
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CLEREZZA-37) Wish for Scala function

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür reassigned CLEREZZA-37:
------------------------------------------

    Assignee: Reto Bachmann-Gmür

> Wish for Scala function
> -----------------------
>
>                 Key: CLEREZZA-37
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-37
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Oliver Strässer
>            Assignee: Reto Bachmann-Gmür
>
> An short function to format Java Datetime, so that we don't need to type everytime this: 
> {if((res/acp("startDate")).length > 0){
>  var startDate = (res/acp("startDate")*);
>    try {
>      {startDate .substring(0, startDate .indexOf('T'))}
>     } catch {
>       case e:Exception => res/acp("startDate")*;
>      }
>     }else {
> ""
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CLEREZZA-37) Wish for Scala function

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805081#action_12805081 ] 

Reto Bachmann-Gmür commented on CLEREZZA-37:
--------------------------------------------

I think the way to do it now correctly would be 

to get the a Date instance using LiteralFactory.getInstace().createObject(classOf[java.util.Date], res/acp("startDate")!.asInstanceOf[TypedLiteral])

This could be simplified with a RichGraphNode shortcut method (TBD) that could look like this: res/acp("startDate").asJavaObject[java.util.Date]

To format the date accoring to your need you should use java.text.DateFormat with a a pattern.

> Wish for Scala function
> -----------------------
>
>                 Key: CLEREZZA-37
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-37
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Oliver Strässer
>
> An short function to format Java Datetime, so that we don't need to type everytime this: 
> {if((res/acp("startDate")).length > 0){
>  var startDate = (res/acp("startDate")*);
>    try {
>      {startDate .substring(0, startDate .indexOf('T'))}
>     } catch {
>       case e:Exception => res/acp("startDate")*;
>      }
>     }else {
> ""
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CLEREZZA-37) Wish for Scala function

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür closed CLEREZZA-37.
--------------------------------------

    Resolution: Fixed

the followingis no supported (res/acp("startDate")).as(classOf[java.util.Date]

> Wish for Scala function
> -----------------------
>
>                 Key: CLEREZZA-37
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-37
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Oliver Strässer
>
> An short function to format Java Datetime, so that we don't need to type everytime this: 
> {if((res/acp("startDate")).length > 0){
>  var startDate = (res/acp("startDate")*);
>    try {
>      {startDate .substring(0, startDate .indexOf('T'))}
>     } catch {
>       case e:Exception => res/acp("startDate")*;
>      }
>     }else {
> ""
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.