JSApp/Date.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 22 CC 2 SCAR 13.9
CC
2
Cov
0%
html
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1  
2 ######################################################################
3 ## $Id: Date.pm 3681 2006-03-13 19:55:12Z spadkins $
4 ######################################################################
5  
6 package App::Widget::JSApp::Date;
7 $VERSION = (q$Revision: 3681 $ =~ /(\d[\d\.]*)/)[0]; # VERSION numbers generated by svn
8  
9 use App::Widget::JSApp;
10 @ISA = ( "App::Widget::JSApp" );
11  
12 use strict;
13  
14 =head1 NAME
15  
16 App::Widget::JSApp::Date - A date widget
17  
18 =head1 SYNOPSIS
19  
20 use App::Widget::JSApp::Date;
21  
22 ...
23  
24 =cut
25  
26 sub html {
27 my $self = shift;
28 my $name = $self->{name};
29  
30 $self->init_jsapp();
31  
32 my $context = $self->{context};
33 my $value = $context->so_get($name);
34 $value = "" if (!defined $value);
35  
36 my $html = <<EOF;
37 <script type="text/javascript">
38 context.widget("$name", {
39 "serviceClass" : "DateWidget",
40 "submittable" : 1,
41 "default" : "$value"
42 }).write();
43 </script>
44 EOF
45  
46 return($html);
47 }
48  
49 1;
50